summaryrefslogtreecommitdiffstats
path: root/src/mesa/glapi/glthread.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2001-11-12 23:50:12 +0000
committerBrian Paul <[email protected]>2001-11-12 23:50:12 +0000
commit1b37d6c3055150fc5321e003bdca057a5b0daafa (patch)
tree3a3790ae5a82268f3d62d69335c71194a24458fe /src/mesa/glapi/glthread.c
parentcd060fc3b44fb41629b5da640f10c3aa3e3c8cfd (diff)
BeOS thread support (Philippe Houdoin)
Diffstat (limited to 'src/mesa/glapi/glthread.c')
-rw-r--r--src/mesa/glapi/glthread.c42
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 */