mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-04 21:33:51 +00:00
(svn r18796) -Fix [FS#3521]: [SDL] possible deadlock when killing OpenTTD while starting it
This commit is contained in:
parent
f43646cd7d
commit
7aeccb9bd0
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user