mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-05 22:46:06 +00:00
glx: unifdef USE_XTHREADS
xthreads is an ancient wrapper around a half dozen or so common thread APIs, including pthreads. Just use pthreads directly if you have it; if you don't, get with the times. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
2371b44f9e
commit
3692ff0b35
2 changed files with 1 additions and 96 deletions
|
|
@ -179,57 +179,6 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
|
|||
|
||||
#endif /* WIN32_THREADS */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* XFree86 has its own thread wrapper, Xthreads.h
|
||||
* We wrap it again for GL.
|
||||
*/
|
||||
#ifdef USE_XTHREADS
|
||||
|
||||
_X_EXPORT unsigned long
|
||||
_glthread_GetID(void)
|
||||
{
|
||||
return (unsigned long) xthread_self();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_glthread_InitTSD(_glthread_TSD *tsd)
|
||||
{
|
||||
if (xthread_key_create(&tsd->key, NULL) != 0) {
|
||||
perror(INIT_TSD_ERROR);
|
||||
exit(-1);
|
||||
}
|
||||
tsd->initMagic = INIT_MAGIC;
|
||||
}
|
||||
|
||||
|
||||
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 != INIT_MAGIC) {
|
||||
_glthread_InitTSD(tsd);
|
||||
}
|
||||
xthread_set_specific(tsd->key, ptr);
|
||||
}
|
||||
|
||||
#endif /* XTHREAD */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* BeOS threads
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue