projects
/
oweals
/
musl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
add legacy sys/ttydefaults.h header
[oweals/musl.git]
/
src
/
thread
/
pthread_detach.c
1
#include "pthread_impl.h"
2
3
int pthread_detach(pthread_t t)
4
{
5
/* Cannot detach a thread that's already exiting */
6
if (a_swap(t->exitlock, 1))
7
return pthread_join(t, 0);
8
t->detached = 2;
9
__unlock(t->exitlock);
10
return 0;
11
}