… | |
… | |
53 | #define X_THREAD_ATFORK(a,b,c) |
53 | #define X_THREAD_ATFORK(a,b,c) |
54 | |
54 | |
55 | static int |
55 | static int |
56 | thread_create (thread_t *tid, void *(*proc)(void *), void *arg) |
56 | thread_create (thread_t *tid, void *(*proc)(void *), void *arg) |
57 | { |
57 | { |
58 | int res; |
58 | int retval; |
59 | pthread_attr_t attr; |
59 | pthread_attr_t attr; |
60 | |
60 | |
61 | pthread_attr_init (&attr); |
61 | pthread_attr_init (&attr); |
62 | pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); |
62 | pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); |
63 | |
63 | |
64 | res = pthread_create (tid, &attr, proc, arg) == 0; |
64 | retval = pthread_create (tid, &attr, proc, arg) == 0; |
65 | |
65 | |
66 | pthread_attr_destroy (&attr); |
66 | pthread_attr_destroy (&attr); |
67 | |
67 | |
68 | return res; |
68 | return retval; |
69 | } |
69 | } |
70 | |
70 | |
71 | #define respipe_read(a,b,c) PerlSock_recv ((a), (b), (c), 0) |
71 | #define respipe_read(a,b,c) PerlSock_recv ((a), (b), (c), 0) |
72 | #define respipe_write(a,b,c) send ((a), (b), (c), 0) |
72 | #define respipe_write(a,b,c) send ((a), (b), (c), 0) |
73 | #define respipe_close(a) PerlSock_closesocket ((a)) |
73 | #define respipe_close(a) PerlSock_closesocket ((a)) |