Listen for shutdown in thread loops.
This way we don't need to use wait_for(), much better. Also because there are slightly more correct cond vars on win32.
This commit is contained in:
parent
4b9056fa02
commit
086294b495
3 changed files with 15 additions and 3 deletions
|
@ -428,6 +428,10 @@ void __IoManagerThread() {
|
|||
}
|
||||
}
|
||||
|
||||
void __IoWakeManager() {
|
||||
ioManager.FinishEventLoop();
|
||||
}
|
||||
|
||||
void __IoInit() {
|
||||
INFO_LOG(SCEIO, "Starting up I/O...");
|
||||
|
||||
|
@ -458,6 +462,7 @@ void __IoInit() {
|
|||
ioManagerThreadEnabled = g_Config.bSeparateIOThread;
|
||||
ioManager.SetThreadEnabled(ioManagerThreadEnabled);
|
||||
if (ioManagerThreadEnabled) {
|
||||
Core_ListenShutdown(&__IoWakeManager);
|
||||
ioManagerThread = new std::thread(&__IoManagerThread);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue