Esempio n. 1
0
void *
_glthread_GetTSD(_glthread_TSD *tsd)
{
   if (tsd->initMagic != (int) INIT_MAGIC) {
      _glthread_InitTSD(tsd);
   }
   return pthread_getspecific(tsd->key);
}
Esempio n. 2
0
void
_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
{
   if (tsd->initMagic != INIT_MAGIC) {
      _glthread_InitTSD(tsd);
   }
   xthread_set_specific(tsd->key, ptr);
}
Esempio n. 3
0
void
_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
{
   if (tsd->initMagic != (int) INIT_MAGIC) {
      _glthread_InitTSD(tsd);
   }
   tls_set(tsd->key, ptr);
}
Esempio n. 4
0
void *
_glthread_GetTSD(_glthread_TSD *tsd)
{
   if (tsd->initMagic != INIT_MAGIC) {
      _glthread_InitTSD(tsd);
   }
   return TlsGetValue(tsd->key);
}
Esempio n. 5
0
void *
_glthread_GetTSD(_glthread_TSD *tsd)
{
   void *ptr;
   if (tsd->initMagic != INIT_MAGIC) {
      _glthread_InitTSD(tsd);
   }
   xthread_get_specific(tsd->key, &ptr);
   return ptr;
}
Esempio n. 6
0
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);
   }
}
Esempio n. 7
0
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);
   }
}
Esempio n. 8
0
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);
   }
}
Esempio n. 9
0
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;
}