mirror of
https://github.com/fluencelabs/musl
synced 2025-07-03 16:41:59 +00:00
simplify pthread tsd key handling
This commit is contained in:
@ -15,7 +15,6 @@ int pthread_key_create(pthread_key_t *k, void (*dtor)(void *))
|
||||
unsigned j = i;
|
||||
|
||||
pthread_self();
|
||||
libc.tsd_keys = keys;
|
||||
if (!dtor) dtor = nodtor;
|
||||
do {
|
||||
if (!a_cas_p(keys+j, 0, dtor)) {
|
||||
@ -26,6 +25,12 @@ int pthread_key_create(pthread_key_t *k, void (*dtor)(void *))
|
||||
return EAGAIN;
|
||||
}
|
||||
|
||||
int pthread_key_delete(pthread_key_t k)
|
||||
{
|
||||
keys[k] = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void __pthread_tsd_run_dtors(pthread_t self)
|
||||
{
|
||||
int i, j, not_finished = self->tsd_used;
|
||||
|
Reference in New Issue
Block a user