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:34:14 +0000
committermarha <marha@users.sourceforge.net>2009-12-22 18:34:14 +0000
commit1e723abc27bdc2ad675bce79467a7308c2966861 (patch)
treea04f4d5cf04567351c85d43e720a3b762322d106 /mesalib/src/mesa/drivers/windows/gdi/InitCritSections.cpp
parentb729d9e1cc1c60e415da24143cabcbaccb525ed7 (diff)
downloadvcxsrv-1e723abc27bdc2ad675bce79467a7308c2966861.tar.gz
vcxsrv-1e723abc27bdc2ad675bce79467a7308c2966861.tar.bz2
vcxsrv-1e723abc27bdc2ad675bce79467a7308c2966861.zip
Forgotten files in previous commit
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