diff options
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/pthread.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/timer.cc | 12 |
3 files changed, 18 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index b71d45b..5d9a4f7 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 f2869c2..b110b83 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 ee4f0d8..9cf9584 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 (¬ify_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 (¬ify_thread, attr, (void * (*) (void *)) tt->evp.sigev_notify_function, tt->evp.sigev_value.sival_ptr); if (rc) |