CriticalSection update for OS/2
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4657 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -542,8 +542,10 @@ wxEvtHandler::wxEvtHandler()
|
|||||||
m_isWindow = FALSE;
|
m_isWindow = FALSE;
|
||||||
m_pendingEvents = (wxList *) NULL;
|
m_pendingEvents = (wxList *) NULL;
|
||||||
#if wxUSE_THREADS
|
#if wxUSE_THREADS
|
||||||
|
# if !defined(__VISAGECPP__)
|
||||||
m_eventsLocker = new wxCriticalSection;
|
m_eventsLocker = new wxCriticalSection;
|
||||||
# endif
|
# endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
wxEvtHandler::~wxEvtHandler()
|
wxEvtHandler::~wxEvtHandler()
|
||||||
@@ -571,15 +573,21 @@ wxEvtHandler::~wxEvtHandler()
|
|||||||
delete m_pendingEvents;
|
delete m_pendingEvents;
|
||||||
|
|
||||||
#if wxUSE_THREADS
|
#if wxUSE_THREADS
|
||||||
|
# if !defined(__VISAGECPP__)
|
||||||
delete m_eventsLocker;
|
delete m_eventsLocker;
|
||||||
# endif
|
# endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_THREADS
|
#if wxUSE_THREADS
|
||||||
|
|
||||||
bool wxEvtHandler::ProcessThreadEvent(wxEvent& event)
|
bool wxEvtHandler::ProcessThreadEvent(wxEvent& event)
|
||||||
{
|
{
|
||||||
|
#if defined(__VISAGECPP__)
|
||||||
|
wxCriticalSectionLocker locker(m_eventsLocker);
|
||||||
|
#else
|
||||||
wxCriticalSectionLocker locker(*m_eventsLocker);
|
wxCriticalSectionLocker locker(*m_eventsLocker);
|
||||||
|
#endif
|
||||||
|
|
||||||
// check that we are really in a child thread
|
// check that we are really in a child thread
|
||||||
wxASSERT_MSG( !wxThread::IsMain(),
|
wxASSERT_MSG( !wxThread::IsMain(),
|
||||||
@@ -614,7 +622,11 @@ void wxEvtHandler::AddPendingEvent(wxEvent& event)
|
|||||||
|
|
||||||
void wxEvtHandler::ProcessPendingEvents()
|
void wxEvtHandler::ProcessPendingEvents()
|
||||||
{
|
{
|
||||||
|
#if defined(__VISAGECPP__)
|
||||||
|
wxCRIT_SECT_LOCKER(locker, &m_eventsLocker);
|
||||||
|
#else
|
||||||
wxCRIT_SECT_LOCKER(locker, m_eventsLocker);
|
wxCRIT_SECT_LOCKER(locker, m_eventsLocker);
|
||||||
|
#endif
|
||||||
|
|
||||||
wxNode *node = m_pendingEvents->First();
|
wxNode *node = m_pendingEvents->First();
|
||||||
wxEvent *event;
|
wxEvent *event;
|
||||||
@@ -779,6 +791,8 @@ void wxEvtHandler::Connect( int id, int lastId,
|
|||||||
m_dynamicEvents->Append( (wxObject*) entry );
|
m_dynamicEvents->Append( (wxObject*) entry );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
// DW: not in header anymore???
|
||||||
bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType,
|
bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType,
|
||||||
wxObjectEventFunction func,
|
wxObjectEventFunction func,
|
||||||
wxObject *userData )
|
wxObject *userData )
|
||||||
@@ -805,6 +819,7 @@ bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType,
|
|||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event )
|
bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user