diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp index 8da80d379b..0e54c0a83b 100644 --- a/src/unix/threadpsx.cpp +++ b/src/unix/threadpsx.cpp @@ -946,7 +946,9 @@ extern "C" void wxPthreadCleanup(void *ptr) void wxThreadInternal::Cleanup(wxThread *thread) { - if (pthread_getspecific(gs_keySelf) == 0) return; + if (pthread_getspecific(gs_keySelf) == 0) + return; + { wxCriticalSectionLocker lock(thread->m_critsect); if ( thread->m_internal->GetState() == STATE_EXITED )