void * _glthread_GetTSD(_glthread_TSD *tsd) { if (tsd->initMagic != (int) INIT_MAGIC) { _glthread_InitTSD(tsd); } return pthread_getspecific(tsd->key); }
void _glthread_SetTSD(_glthread_TSD *tsd, void *ptr) { if (tsd->initMagic != INIT_MAGIC) { _glthread_InitTSD(tsd); } xthread_set_specific(tsd->key, ptr); }
void _glthread_SetTSD(_glthread_TSD *tsd, void *ptr) { if (tsd->initMagic != (int) INIT_MAGIC) { _glthread_InitTSD(tsd); } tls_set(tsd->key, ptr); }
void * _glthread_GetTSD(_glthread_TSD *tsd) { if (tsd->initMagic != INIT_MAGIC) { _glthread_InitTSD(tsd); } return TlsGetValue(tsd->key); }
void * _glthread_GetTSD(_glthread_TSD *tsd) { void *ptr; if (tsd->initMagic != INIT_MAGIC) { _glthread_InitTSD(tsd); } xthread_get_specific(tsd->key, &ptr); return ptr; }
void _glthread_SetTSD(_glthread_TSD *tsd, void *ptr) { if (tsd->initMagic != (int) INIT_MAGIC) { _glthread_InitTSD(tsd); } if (pthread_setspecific(tsd->key, ptr) != 0) { perror(SET_TSD_ERROR); exit(-1); } }
void _glthread_SetTSD(_glthread_TSD *tsd, void *ptr) { /* the following code assumes that the _glthread_TSD has been initialized to zero at creation */ if (tsd->initMagic != INIT_MAGIC) { _glthread_InitTSD(tsd); } if (TlsSetValue(tsd->key, ptr) == 0) { perror("Mesa:_glthread_SetTSD"); InsteadOf_exit(-1); } }
void _glthread_SetTSD(_glthread_TSD *tsd, void *ptr) { /* the following code assumes that the _glthread_TSD has been initialized to zero at creation */ if (tsd->initMagic != INIT_MAGIC) { _glthread_InitTSD(tsd); } if (TlsSetValue(tsd->key, ptr) == 0) { /* Can Windows handle stderr messages for non-console applications? Does Windows have perror? */ /* perror(SET_TSD_ERROR);*/ exit(-1); } }
void * _glthread_GetTSD(_glthread_TSD *tsd) { void* ret; if (tsd->initMagic != INIT_MAGIC) { _glthread_InitTSD(tsd); } #ifdef USE_LOCK_FOR_KEY mutex_lock(&tsd->keylock); thr_getspecific(tsd->key, &ret); mutex_unlock(&tsd->keylock); #else if ((errno = thr_getspecific(tsd->key, &ret)) != 0) { perror(GET_TSD_ERROR); exit(-1); } #endif return ret; }