Changeset - r14235:7085b981d4d2
[Not reviewed]
master
0 1 0
rubidium - 14 years ago 2010-01-13 21:34:48
rubidium@openttd.org
(svn r18796) -Fix [FS#3521]: [SDL] possible deadlock when killing OpenTTD while starting it
1 file changed with 7 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/video/sdl_v.cpp
Show inline comments
 
@@ -112,8 +112,11 @@ static void DrawSurfaceToScreen()
 

	
 
static void DrawSurfaceToScreenThread(void *)
 
{
 
	/* First wait till we 'may' start */
 
	/* First tell the main thread we're started */
 
	_draw_mutex->BeginCritical();
 
	_draw_mutex->SendSignal();
 

	
 
	/* Now wait for the first thing to draw! */
 
	_draw_mutex->WaitForSignal();
 

	
 
	while (_draw_continue) {
 
@@ -516,6 +519,9 @@ void VideoDriver_SDL::MainLoop()
 
			if (!_draw_threaded) {
 
				_draw_mutex->EndCritical();
 
				delete _draw_mutex;
 
			} else {
 
				/* Wait till the draw mutex has started itself. */
 
				_draw_mutex->WaitForSignal();
 
			}
 
		}
 
	}
0 comments (0 inline, 0 general)