+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
{
/* 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);
{
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)