aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/drivers/windows/gdi/InitCritSections.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-12-22 18:41:22 +0000
committermarha <marha@users.sourceforge.net>2009-12-22 18:41:22 +0000
commitad01e57c327538a3d75fb24ad18b54b0fceb21cc (patch)
tree72af2496df52b8ccfbf18d50b7378b63485fa62d /mesalib/src/mesa/drivers/windows/gdi/InitCritSections.cpp
parent3b79162ea5c5be078326f2e0ea85b0f84c02f166 (diff)
parent1e723abc27bdc2ad675bce79467a7308c2966861 (diff)
downloadvcxsrv-ad01e57c327538a3d75fb24ad18b54b0fceb21cc.tar.gz
vcxsrv-ad01e57c327538a3d75fb24ad18b54b0fceb21cc.tar.bz2
vcxsrv-ad01e57c327538a3d75fb24ad18b54b0fceb21cc.zip
svn merge ^/branches/released
Diffstat (limited to 'mesalib/src/mesa/drivers/windows/gdi/InitCritSections.cpp')
-rw-r--r--mesalib/src/mesa/drivers/windows/gdi/InitCritSections.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/mesalib/src/mesa/drivers/windows/gdi/InitCritSections.cpp b/mesalib/src/mesa/drivers/windows/gdi/InitCritSections.cpp
new file mode 100644
index 000000000..7145bffa5
--- /dev/null
+++ b/mesalib/src/mesa/drivers/windows/gdi/InitCritSections.cpp
@@ -0,0 +1,32 @@
+#include "glapi.h"
+#include "glThread.h"
+
+#ifdef WIN32_THREADS
+extern "C" _glthread_Mutex OneTimeLock;
+extern "C" _glthread_Mutex GenTexturesLock;
+
+extern "C" void FreeAllTSD(void);
+
+class _CriticalSectionInit
+{
+public:
+ static _CriticalSectionInit m_inst;
+
+ _CriticalSectionInit()
+ {
+ _glthread_INIT_MUTEX(OneTimeLock);
+ _glthread_INIT_MUTEX(GenTexturesLock);
+ }
+
+ ~_CriticalSectionInit()
+ {
+ _glthread_DESTROY_MUTEX(OneTimeLock);
+ _glthread_DESTROY_MUTEX(GenTexturesLock);
+ FreeAllTSD();
+ }
+};
+
+_CriticalSectionInit _CriticalSectionInit::m_inst;
+
+
+#endif