Clean up threading code some more

This commit is contained in:
Justine Tunney 2022-09-13 14:57:38 -07:00
parent 6a3330d7c9
commit 654ceaba7d
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
28 changed files with 119 additions and 134 deletions

View file

@ -18,13 +18,14 @@
*/
#include "libc/thread/posixthread.internal.h"
#include "libc/thread/thread.h"
#include "libc/thread/tls.h"
/**
* Gets value of TLS slot for current thread.
*/
void *pthread_getspecific(pthread_key_t key) {
if (0 <= key && key < PTHREAD_KEYS_MAX) {
return _pthread_keys[key];
return __get_tls()->tib_keys[key];
} else {
return 0;
}