Split wxWakeUpPipe class in MT-unsafe and MT-safe parts.
This class can also be useful when it's used in the main thread only, so leave the lock-less part of the code in wxWakeUpPipe and derive a separate wxWakeUpPipeMT from it for the use in wxConsoleEventLoop where it can be used by multiple threads. See #10258. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74339 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -69,10 +69,8 @@ wxWakeUpPipe::wxWakeUpPipe()
|
||||
// wakeup handling
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxWakeUpPipe::WakeUp()
|
||||
void wxWakeUpPipe::WakeUpNoLock()
|
||||
{
|
||||
wxCriticalSectionLocker lock(m_pipeLock);
|
||||
|
||||
// No need to do anything if the pipe already contains something.
|
||||
if ( !m_pipeIsEmpty )
|
||||
return;
|
||||
@@ -95,8 +93,6 @@ void wxWakeUpPipe::OnReadWaiting()
|
||||
// got wakeup from child thread, remove the data that provoked it from the
|
||||
// pipe
|
||||
|
||||
wxCriticalSectionLocker lock(m_pipeLock);
|
||||
|
||||
char buf[4];
|
||||
for ( ;; )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user