diff options
Diffstat (limited to 'src/mesa/glapi/glthread.c')
-rw-r--r-- | src/mesa/glapi/glthread.c | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/src/mesa/glapi/glthread.c b/src/mesa/glapi/glthread.c index 16b3336b9f4..778fa4873c8 100644 --- a/src/mesa/glapi/glthread.c +++ b/src/mesa/glapi/glthread.c @@ -1,4 +1,4 @@ -/* $Id: glthread.c,v 1.8 2001/03/12 00:48:38 gareth Exp $ */ +/* $Id: glthread.c,v 1.9 2001/11/12 23:50:12 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -292,6 +292,46 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr) +/* + * BeOS threads + */ +#ifdef BEOS_THREADS + +unsigned long +_glthread_GetID(void) +{ + return (unsigned long) find_thread(NULL); +} + +void +_glthread_InitTSD(_glthread_TSD *tsd) +{ + tsd->key = tls_allocate(); + tsd->initMagic = INIT_MAGIC; +} + +void * +_glthread_GetTSD(_glthread_TSD *tsd) +{ + if (tsd->initMagic != (int) INIT_MAGIC) { + _glthread_InitTSD(tsd); + } + return tls_get(tsd->key); +} + +void +_glthread_SetTSD(_glthread_TSD *tsd, void *ptr) +{ + if (tsd->initMagic != (int) INIT_MAGIC) { + _glthread_InitTSD(tsd); + } + tls_set(tsd->key, ptr); +} + +#endif /* BEOS_THREADS */ + + + #else /* THREADS */ |