Sign in
mojo
/
mojo-tools
/
862d13b6f591fb83034e80ed5a8c59fb9d0b7b56
/
.
/
fusl
/
src
/
thread
/
pthread_setspecific.c
blob: 720495d5dab65f0a4b8461c99b14188b971b58e5 [
file
] [
log
] [
blame
]
#include
"pthread_impl.h"
int
pthread_setspecific
(
pthread_key_t
k
,
const
void
*
x
)
{
struct
pthread
*
self
=
__pthread_self
();
/* Avoid unnecessary COW */
if
(
self
->
tsd
[
k
]
!=
x
)
{
self
->
tsd
[
k
]
=
(
void
*)
x
;
self
->
tsd_used
=
1
;
}
return
0
;
}