]> sourceware.org Git - newlib-cygwin.git/commitdiff
* pthread.cc (pthread_create): Very minor formatting change.
authorChristopher Faylor <me@cgf.cx>
Tue, 7 Oct 2008 23:28:30 +0000 (23:28 +0000)
committerChristopher Faylor <me@cgf.cx>
Tue, 7 Oct 2008 23:28:30 +0000 (23:28 +0000)
* timer.cc (timer_thread): Ensure that any created thread defaults to detached
state.

winsup/cygwin/ChangeLog
winsup/cygwin/pthread.cc
winsup/cygwin/timer.cc

index b71d45b82de103750b1aff5c65618b4149998b92..5d9a4f79d9f10bb4f3397b8c7eda58fd0d365202 100644 (file)
@@ -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
index f2869c29404a3f26edfc28f8db269adffad8d13c..b110b831bc3047031e98b81e93a64dcb97323228 100644 (file)
@@ -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);
index ee4f0d803cbcd8f9cefb12b7ee0fe0fd59fd792c..9cf95848e5d8e77ce396d83b64c5e5009089018e 100644 (file)
@@ -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)
This page took 0.034963 seconds and 5 git commands to generate.