diff options
author | Jonathan Marler <johnnymarler@gmail.com> | 2018-10-09 21:21:30 -0600 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2018-10-09 20:21:30 -0700 |
commit | 8bd74e1ca81ef6e4322358e1cc966e26c6153dcc (patch) | |
tree | 836fc08e76cbc30147daa7e08dfb7c51c3abe62b /src | |
parent | cfe51dd00e069e9fcbee6843e0eee2e80c9b3bd1 (diff) | |
download | coreclr-8bd74e1ca81ef6e4322358e1cc966e26c6153dcc.tar.gz coreclr-8bd74e1ca81ef6e4322358e1cc966e26c6153dcc.tar.bz2 coreclr-8bd74e1ca81ef6e4322358e1cc966e26c6153dcc.zip |
Fix issue 20261: infinite recursion for non PAL threads (#20267)
Diffstat (limited to 'src')
-rw-r--r-- | src/pal/src/misc/dbgmsg.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/pal/src/misc/dbgmsg.cpp b/src/pal/src/misc/dbgmsg.cpp index a154cb4b1e..d9bb40ef59 100644 --- a/src/pal/src/misc/dbgmsg.cpp +++ b/src/pal/src/misc/dbgmsg.cpp @@ -477,7 +477,6 @@ int DBG_printf_gcc(DBG_CHANNEL_ID channel, DBG_LEVEL_ID level, BOOL bHeader, va_list args; void *thread_id; int old_errno = 0; - CPalThread *pthrCurrent = InternalGetCurrentThread(); old_errno = errno; @@ -537,9 +536,9 @@ int DBG_printf_gcc(DBG_CHANNEL_ID channel, DBG_LEVEL_ID level, BOOL bHeader, avoid holding a libc lock while another thread is calling SuspendThread on this one. */ - InternalEnterCriticalSection(pthrCurrent, &fprintf_crit_section); + InternalEnterCriticalSection(NULL, &fprintf_crit_section); fprintf( output_file, "%s%s", indent, buffer ); - InternalLeaveCriticalSection(pthrCurrent, &fprintf_crit_section); + InternalLeaveCriticalSection(NULL, &fprintf_crit_section); /* flush the output to file */ if ( fflush(output_file) != 0 ) @@ -596,7 +595,6 @@ int DBG_printf_c99(DBG_CHANNEL_ID channel, DBG_LEVEL_ID level, BOOL bHeader, static INT call_count=0; // only use inside the crit section void *thread_id; int old_errno = 0; - CPalThread *pthrCurrent = InternalGetCurrentThread(); old_errno = errno; @@ -641,7 +639,7 @@ int DBG_printf_c99(DBG_CHANNEL_ID channel, DBG_LEVEL_ID level, BOOL bHeader, SuspendThread on this one. */ BOOL do_flush = FALSE; - InternalEnterCriticalSection(pthrCurrent, &fprintf_crit_section); + InternalEnterCriticalSection(NULL, &fprintf_crit_section); fprintf( output_file, "%s", buffer ); call_count++; // can use call_count because we are in the crit section if (call_count>5) @@ -649,7 +647,7 @@ int DBG_printf_c99(DBG_CHANNEL_ID channel, DBG_LEVEL_ID level, BOOL bHeader, call_count = 0; do_flush = TRUE; } - InternalLeaveCriticalSection(pthrCurrent, &fprintf_crit_section); + InternalLeaveCriticalSection(NULL, &fprintf_crit_section); /* flush the output to file every once in a while */ if (do_flush) |