git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32506
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#if wxUSE_THREADS
#if defined (__VISAGECPP__)
#if wxUSE_THREADS
#if defined (__VISAGECPP__)
+ const wxCriticalSection& Lock() const { return m_eventsLocker; }
+ wxCriticalSection& Lock() { return m_eventsLocker; }
+
wxCriticalSection m_eventsLocker;
# else
wxCriticalSection m_eventsLocker;
# else
+ const wxCriticalSection& Lock() const { return *m_eventsLocker; }
+ wxCriticalSection& Lock() { return *m_eventsLocker; }
+
wxCriticalSection* m_eventsLocker;
# endif
#endif
wxCriticalSection* m_eventsLocker;
# endif
#endif
wxCHECK_RET( eventCopy,
_T("events of this type aren't supposed to be posted") );
wxCHECK_RET( eventCopy,
_T("events of this type aren't supposed to be posted") );
-#if defined(__VISAGECPP__)
- wxENTER_CRIT_SECT( m_eventsLocker);
-#else
- wxENTER_CRIT_SECT( *m_eventsLocker);
-#endif
+ wxENTER_CRIT_SECT( Lock() );
if ( !m_pendingEvents )
m_pendingEvents = new wxList;
m_pendingEvents->Append(eventCopy);
if ( !m_pendingEvents )
m_pendingEvents = new wxList;
m_pendingEvents->Append(eventCopy);
-#if defined(__VISAGECPP__)
- wxLEAVE_CRIT_SECT( m_eventsLocker);
-#else
- wxLEAVE_CRIT_SECT( *m_eventsLocker);
-#endif
+ wxLEAVE_CRIT_SECT( Lock() );
// 2) Add this event handler to list of event handlers that
// have pending events.
// 2) Add this event handler to list of event handlers that
// have pending events.
wxCHECK_RET( m_pendingEvents,
wxT("Please call wxApp::ProcessPendingEvents() instead") );
wxCHECK_RET( m_pendingEvents,
wxT("Please call wxApp::ProcessPendingEvents() instead") );
-#if defined(__VISAGECPP__)
- wxENTER_CRIT_SECT( m_eventsLocker);
-#else
- wxENTER_CRIT_SECT( *m_eventsLocker);
-#endif
+ wxENTER_CRIT_SECT( Lock() );
// remember last event to process during this iteration
wxList::compatibility_iterator lastPendingNode = m_pendingEvents->GetLast();
// remember last event to process during this iteration
wxList::compatibility_iterator lastPendingNode = m_pendingEvents->GetLast();
// In ProcessEvent, new events might get added and
// we can safely leave the crtical section here.
// In ProcessEvent, new events might get added and
// we can safely leave the crtical section here.
-#if defined(__VISAGECPP__)
- wxLEAVE_CRIT_SECT( m_eventsLocker);
-#else
- wxLEAVE_CRIT_SECT( *m_eventsLocker);
-#endif
+ wxLEAVE_CRIT_SECT( Lock() );
ProcessEvent(*event);
delete event;
ProcessEvent(*event);
delete event;
-#if defined(__VISAGECPP__)
- wxENTER_CRIT_SECT( m_eventsLocker);
-#else
- wxENTER_CRIT_SECT( *m_eventsLocker);
-#endif
+ wxENTER_CRIT_SECT( Lock() );
// leave the loop once we have processed all events that were present
// at the start of ProcessPendingEvents because otherwise we could get
// leave the loop once we have processed all events that were present
// at the start of ProcessPendingEvents because otherwise we could get
node = m_pendingEvents->GetFirst();
}
node = m_pendingEvents->GetFirst();
}
-#if defined(__VISAGECPP__)
- wxLEAVE_CRIT_SECT( m_eventsLocker);
-#else
- wxLEAVE_CRIT_SECT( *m_eventsLocker);
-#endif
+ wxLEAVE_CRIT_SECT( Lock() );