summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2012-01-04 00:45:36 +0000
committermichi_cc <michi_cc@openttd.org>2012-01-04 00:45:36 +0000
commit52175a4260ae01e423ecbc401bbd262e8b45794f (patch)
treedb85b377a54df8a77837d92e63c51f060d2b88fb /src
parentbc9c8db287a1e2f7f81f24f67373627c56a5c3dd (diff)
downloadopenttd-52175a4260ae01e423ecbc401bbd262e8b45794f.tar.xz
(svn r23749) -Fix: [Win32] Work around a possible deadlock when initialising threaded drawing.
Diffstat (limited to 'src')
-rw-r--r--src/video/win32_v.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index 934acc061..270af12e8 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -384,6 +384,10 @@ static void PaintWindowThread(void *)
_draw_mutex->BeginCritical();
_draw_mutex->SendSignal();
+ /* Do our best to make sure the main thread is the one that
+ * gets the signal, and not our wait below. */
+ Sleep(0);
+
/* Now wait for the first thing to draw! */
_draw_mutex->WaitForSignal();