changeset 18900:5d374231c157 draft

(svn r23749) -Fix: [Win32] Work around a possible deadlock when initialising threaded drawing.
author michi_cc <michi_cc@openttd.org>
date Wed, 04 Jan 2012 00:45:36 +0000
parents 4f5beedddd45
children 0551c0afdaad
files src/video/win32_v.cpp
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -384,6 +384,10 @@
 	_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();