don't lock the gs_prevCS critical section recursively (replaces patch 1857581)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50993 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-01-02 21:18:15 +00:00
parent 9d59b50a9f
commit dbaa16de07
3 changed files with 14 additions and 5 deletions

View File

@@ -457,10 +457,15 @@ void WXDLLIMPEXP_BASE wxVLogSysError(unsigned long err, const wxString& format,
// wxLog class implementation
// ----------------------------------------------------------------------------
unsigned wxLog::LogLastRepetitionCountIfNeeded()
unsigned wxLog::LogLastRepeatIfNeeded()
{
wxCRIT_SECT_LOCKER(lock, ms_prevCS);
return LogLastRepeatIfNeededUnlocked();
}
unsigned wxLog::LogLastRepeatIfNeededUnlocked()
{
const unsigned count = ms_prevCounter;
if ( ms_prevCounter )
@@ -485,7 +490,7 @@ unsigned wxLog::LogLastRepetitionCountIfNeeded()
wxLog::~wxLog()
{
LogLastRepetitionCountIfNeeded();
LogLastRepeatIfNeeded();
}
/* static */
@@ -509,7 +514,7 @@ void wxLog::OnLog(wxLogLevel level, const wxString& szString, time_t t)
return;
}
pLogger->LogLastRepetitionCountIfNeeded();
pLogger->LogLastRepeatIfNeededUnlocked();
// reset repetition counter for a new message
ms_prevString = szString;