Merge branch 'mesa_7_7_branch'
[mesa.git] / src / mesa / glapi / glthread.c
index 56ddf7c25acceea2bf038c37e30235d2b1ac41f5..f480edff4e8a868234aee552113a66a2181970c9 100644 (file)
@@ -32,7 +32,7 @@
 #include <dix-config.h>
 #endif
 
-#include "main/glheader.h"
+#include "main/compiler.h"
 #include "glthread.h"
 
 
@@ -69,7 +69,7 @@
  */
 #ifdef PTHREADS
 
-unsigned long
+PUBLIC unsigned long
 _glthread_GetID(void)
 {
    return (unsigned long) pthread_self();
@@ -123,7 +123,7 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
 #define USE_LOCK_FOR_KEY       /* undef this to try a version without
                                   lock for the global key... */
 
-unsigned long
+PUBLIC unsigned long
 _glthread_GetID(void)
 {
    abort();   /* XXX not implemented yet */
@@ -201,7 +201,7 @@ void InsteadOf_exit(int nCode)
    DWORD dwErr=GetLastError();
 }
 
-unsigned long
+PUBLIC unsigned long
 _glthread_GetID(void)
 {
    return GetCurrentThreadId();
@@ -246,63 +246,12 @@ _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
-
-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
  */
 #ifdef BEOS_THREADS
 
-unsigned long
+PUBLIC unsigned long
 _glthread_GetID(void)
 {
    return (unsigned long) find_thread(NULL);
@@ -344,7 +293,7 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
  * no-op functions
  */
 
-unsigned long
+PUBLIC unsigned long
 _glthread_GetID(void)
 {
    return 0;