mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 23:10:58 +00:00
UKERNEL: allow creation of non-detached threads
Make usr_thread_create create a non-detached thread by default, and just have callers call usr_thread_detach if they want it detached. The only current caller of usr_thread_create already calls usr_thread_detach. Also add usr_thread_join to make it possible to join a created thread. Change-Id: Iad581c45d36dc43e94c950a5ca6a41dea8dc4b2f Reviewed-on: http://gerrit.openafs.org/1722 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
parent
2f03d4e6e2
commit
f54785bded
@ -952,10 +952,10 @@ extern pthread_cond_t usr_sleep_cond;
|
||||
pthread_attr_t attr; \
|
||||
assert(pthread_attr_init(&attr) == 0); \
|
||||
assert(pthread_attr_setstacksize(&attr, 124288) == 0); \
|
||||
assert(pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED) == 0); \
|
||||
assert(pthread_create((A), &attr, (B), (void *)(C)) == 0); \
|
||||
assert(pthread_attr_destroy(&attr) == 0); \
|
||||
} while(0)
|
||||
#define usr_thread_join(A,B) pthread_join(A, B)
|
||||
#define usr_thread_detach(A) pthread_detach(A)
|
||||
#define usr_keycreate(A,B) assert(pthread_key_create(A,B) == 0)
|
||||
#define usr_setspecific(A,B) pthread_setspecific(A,B)
|
||||
|
Loading…
Reference in New Issue
Block a user