mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Clean up threading code some more
This commit is contained in:
parent
6a3330d7c9
commit
654ceaba7d
28 changed files with 119 additions and 134 deletions
|
@ -19,13 +19,14 @@
|
|||
#include "libc/errno.h"
|
||||
#include "libc/thread/posixthread.internal.h"
|
||||
#include "libc/thread/thread.h"
|
||||
#include "libc/thread/tls.h"
|
||||
|
||||
/**
|
||||
* Sets value of TLS slot for current thread.
|
||||
*/
|
||||
int pthread_setspecific(pthread_key_t key, void *val) {
|
||||
if (0 <= key && key < PTHREAD_KEYS_MAX) {
|
||||
_pthread_keys[key] = val;
|
||||
__get_tls()->tib_keys[key] = val;
|
||||
return 0;
|
||||
} else {
|
||||
return EINVAL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue