From 456dbe134e316e071f210c05ae4ca7cca0afafa7 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Fri, 27 Jul 2012 19:07:54 +0000 Subject: [PATCH] core: make the IO thread exit cleanly. --- src/ticker.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/ticker.cpp b/src/ticker.cpp index 13f122bc..fb114f63 100644 --- a/src/ticker.cpp +++ b/src/ticker.cpp @@ -55,6 +55,7 @@ public: frame - quitframe); #endif gametick.Push(0); + disktick.Push(0); delete gamethread; delete diskthread; } @@ -75,7 +76,7 @@ private: static void *DrawThreadMain(void *p); /* unused */ static void *DiskThreadMain(void *p); Thread *gamethread, *drawthread, *diskthread; - Queue gametick, drawtick; + Queue gametick, drawtick, disktick; /* Shutdown management */ int quit, quitframe, quitdelay, panic; @@ -315,12 +316,7 @@ void *TickerData::DrawThreadMain(void * /* p */) void *TickerData::DiskThreadMain(void * /* p */) { /* FIXME: temporary hack to avoid crashes on the PS3 */ - Timer t; - for (;;) - { - t.Get(); - t.Wait(0.01f); - } + data->disktick.Pop(); return NULL; }