// log a message indicating the number of times the previous message was
// repeated if ms_prevCounter > 0, does nothing otherwise; return the old
// value of ms_prevCounter
- unsigned LogLastRepetitionCountIfNeeded();
+ unsigned LogLastRepeatIfNeeded();
private:
+ // implement of LogLastRepeatIfNeeded(): it assumes that the
+ // caller had already locked ms_prevCS
+ unsigned LogLastRepeatIfNeededUnlocked();
+
// static variables
// ----------------
// 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 )
wxLog::~wxLog()
{
- LogLastRepetitionCountIfNeeded();
+ LogLastRepeatIfNeeded();
}
/* static */
return;
}
- pLogger->LogLastRepetitionCountIfNeeded();
+ pLogger->LogLastRepeatIfNeededUnlocked();
// reset repetition counter for a new message
ms_prevString = szString;
// do it right now to block any new calls to Flush() while we're here
m_bHasMessages = false;
- const unsigned repeatCount = LogLastRepetitionCountIfNeeded();
+ const unsigned repeatCount = LogLastRepeatIfNeeded();
wxString appName = wxTheApp->GetAppDisplayName();