--- libeio/xthread.h 2008/05/10 17:16:39 1.1 +++ libeio/xthread.h 2008/05/12 12:36:21 1.2 @@ -55,12 +55,17 @@ static int thread_create (thread_t *tid, void *(*proc)(void *), void *arg) { + int res; pthread_attr_t attr; pthread_attr_init (&attr); pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); - return pthread_create (tid, &attr, proc, arg) == 0; + res = pthread_create (tid, &attr, proc, arg) == 0; + + pthread_attr_destroy (&attr); + + return res; } #define respipe_read(a,b,c) PerlSock_recv ((a), (b), (c), 0) @@ -131,6 +136,8 @@ retval = pthread_create (tid, &attr, proc, arg) == 0; pthread_sigmask (SIG_SETMASK, &oldsigset, 0); + pthread_attr_destroy (&attr); + return retval; }