summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/windows
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/windows')
-rw-r--r--src/mesa/drivers/windows/gdi/InitCritSections.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/mesa/drivers/windows/gdi/InitCritSections.cpp b/src/mesa/drivers/windows/gdi/InitCritSections.cpp
new file mode 100644
index 0000000000..7145bffa51
--- /dev/null
+++ b/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