From ea79d74953faa1faa007061db980a703ed195d3e Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Thu, 8 Aug 2019 22:49:39 +0000 Subject: [PATCH] Revert r7908 because it introduces a race on dabuf git-svn-id: https://svn.eduke32.com/eduke32@7928 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/sdlayer.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/build/src/sdlayer.cpp b/source/build/src/sdlayer.cpp index cd366ff91..633e66472 100644 --- a/source/build/src/sdlayer.cpp +++ b/source/build/src/sdlayer.cpp @@ -726,11 +726,10 @@ void initputs(const char *buf) OSD_Puts(buf); // Bprintf("%s", buf); + mutex_lock(&m_initprintf); if (Bstrlen(dabuf) + Bstrlen(buf) > 1022) { - mutex_lock(&m_initprintf); startwin_puts(dabuf); - mutex_unlock(&m_initprintf); Bmemset(dabuf, 0, sizeof(dabuf)); } @@ -738,9 +737,7 @@ void initputs(const char *buf) if (g_logFlushWindow || Bstrlen(dabuf) > 768) { - mutex_lock(&m_initprintf); startwin_puts(dabuf); - mutex_unlock(&m_initprintf); #ifndef _WIN32 startwin_idle(NULL); #else @@ -748,6 +745,7 @@ void initputs(const char *buf) #endif Bmemset(dabuf, 0, sizeof(dabuf)); } + mutex_unlock(&m_initprintf); } //