summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/wgl/shared/stw_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/wgl/shared/stw_device.c')
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_device.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/wgl/shared/stw_device.c b/src/gallium/state_trackers/wgl/shared/stw_device.c
index 097e6ea62b..0dca856d73 100644
--- a/src/gallium/state_trackers/wgl/shared/stw_device.c
+++ b/src/gallium/state_trackers/wgl/shared/stw_device.c
@@ -27,6 +27,7 @@
#include <windows.h>
+#include "glapi/glthread.h"
#include "util/u_debug.h"
#include "pipe/p_screen.h"
@@ -35,6 +36,11 @@
#include "shared/stw_pixelformat.h"
#include "shared/stw_public.h"
+#ifdef WIN32_THREADS
+extern _glthread_Mutex OneTimeLock;
+extern void FreeAllTSD(void);
+#endif
+
struct stw_device *stw_dev = NULL;
@@ -73,6 +79,10 @@ st_init(const struct stw_winsys *stw_winsys)
stw_dev->stw_winsys = stw_winsys;
+#ifdef WIN32_THREADS
+ _glthread_INIT_MUTEX(OneTimeLock);
+#endif
+
stw_dev->screen = stw_winsys->create_screen();
if(!stw_dev->screen)
goto error1;
@@ -114,6 +124,11 @@ st_cleanup(void)
stw_dev->screen->destroy(stw_dev->screen);
+#ifdef WIN32_THREADS
+ _glthread_DESTROY_MUTEX(OneTimeLock);
+ FreeAllTSD();
+#endif
+
#ifdef DEBUG
debug_memory_end(stw_dev->memdbg_no);
#endif