mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-01-22 01:01:12 +00:00
d5fd0990a1
If those functions (e.g. called by common->Printf(), common->Error()) weren't called from the mainthread and win_outputEditString was set to 1, a deadlock could occur. Specifically, the async thread (handling sound) was calling common->Warning() -> Sys_Printf() -> Conbuf_AppendText() which called SendMessageA() which blocks until the main thread handles the message. The main thread however was in idSampleDecoderLocal::Decode() trying to enter CRITICAL_SECTION_ONE, which was held by the async thread (it's used to synchronize sound handling between main and async thread). So now if Sys_Printf() (or Sys_Error() which should have the same problem) is not called by the main thread, the text is buffered and Conbuf_AppendText() is called for the buffered lines in the next frame in Win_Frame(). |
||
---|---|---|
.. | ||
rc | ||
sdk | ||
SDL_win32_main.c | ||
win_input.cpp | ||
win_local.h | ||
win_main.cpp | ||
win_net.cpp | ||
win_shared.cpp | ||
win_syscon.cpp |