summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/timer.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2008-10-07 23:28:30 +0000
committerChristopher Faylor <me@cgf.cx>2008-10-07 23:28:30 +0000
commitc4cb50b3a8f5c9da2a0d2ff40620756d0b6e7a5c (patch)
tree5bb40c1944bafef5ef3774614dcbf2302213fa28 /winsup/cygwin/timer.cc
parentf241db6f60c8f4867507c0b8abe5a584e7969aca (diff)
downloadcygnal-c4cb50b3a8f5c9da2a0d2ff40620756d0b6e7a5c.tar.gz
cygnal-c4cb50b3a8f5c9da2a0d2ff40620756d0b6e7a5c.tar.bz2
cygnal-c4cb50b3a8f5c9da2a0d2ff40620756d0b6e7a5c.zip
* pthread.cc (pthread_create): Very minor formatting change.
* timer.cc (timer_thread): Ensure that any created thread defaults to detached state.
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)