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:
Diffstat (limited to 'winsup/cygwin/timer.cc')
-rw-r--r--winsup/cygwin/timer.cc12
1 files changed, 11 insertions, 1 deletions
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)