private extern class NativePthreadKey in "C" `{ pthread_key_t * `}
new `{
pthread_key_t *key = malloc(sizeof(pthread_key_t));
int r = pthread_key_create(key, NULL);
if (r != 0) {
free(key);
return NULL;
}
return key;
`}
fun get: nullable Object `{
void *val = pthread_getspecific(*self);
if (val == NULL) val = null_Object();
return val;
`}
fun set(val: nullable Object) `{
pthread_setspecific(*self, val);
`}
end
lib/pthreads/pthreads.nit:251,1--271,3