Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2008-10-08 03:28:30 +0400
committerChristopher Faylor <me@cgf.cx>2008-10-08 03:28:30 +0400
commitc4cb50b3a8f5c9da2a0d2ff40620756d0b6e7a5c (patch)
tree5bb40c1944bafef5ef3774614dcbf2302213fa28
parentf241db6f60c8f4867507c0b8abe5a584e7969aca (diff)
* pthread.cc (pthread_create): Very minor formatting change.
* timer.cc (timer_thread): Ensure that any created thread defaults to detached state.
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/pthread.cc2
-rw-r--r--winsup/cygwin/timer.cc12
3 files changed, 18 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index b71d45b82..5d9a4f79d 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2008-10-07 Christopher Faylor <me+cygwin@cgf.cx>
+
+ * pthread.cc (pthread_create): Very minor formatting change.
+ * timer.cc (timer_thread): Ensure that any created thread defaults to
+ detached state.
+
2008-10-06 Christopher Faylor <me+cygwin@cgf.cx>
* cygtls.h (_cygtls::initialized): Remove bogus stack check which would
diff --git a/winsup/cygwin/pthread.cc b/winsup/cygwin/pthread.cc
index f2869c294..b110b831b 100644
--- a/winsup/cygwin/pthread.cc
+++ b/winsup/cygwin/pthread.cc
@@ -17,7 +17,7 @@ extern "C"
{
/* ThreadCreation */
int
-pthread_create (pthread_t * thread, const pthread_attr_t * attr,
+pthread_create (pthread_t *thread, const pthread_attr_t *attr,
void *(*start_routine) (void *), void *arg)
{
return pthread::create (thread, attr, start_routine, arg);
diff --git a/winsup/cygwin/timer.cc b/winsup/cygwin/timer.cc
index ee4f0d803..9cf95848e 100644
--- a/winsup/cygwin/timer.cc
+++ b/winsup/cygwin/timer.cc
@@ -170,7 +170,17 @@ timer_thread (VOID *x)
{
pthread_t notify_thread;
debug_printf ("%p starting thread", x);
- int rc = pthread_create (&notify_thread, tt->evp.sigev_notify_attributes,
+ pthread_attr_t *attr;
+ pthread_attr_t default_attr;
+ if (tt->evp.sigev_notify_attributes)
+ attr = tt->evp.sigev_notify_attributes;
+ else
+ {
+ pthread_attr_init(attr = &default_attr);
+ pthread_attr_setdetachstate (attr, PTHREAD_CREATE_DETACHED);
+ }
+
+ int rc = pthread_create (&notify_thread, attr,
(void * (*) (void *)) tt->evp.sigev_notify_function,
tt->evp.sigev_value.sival_ptr);
if (rc)