X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/062c4861718a681a27384d6a2313fc26cda3b3e4..849949b13fa19002da52333e760ebfecd00c60d9:/src/unix/threadpsx.cpp diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp index aad7082be4..eee36b4d3a 100644 --- a/src/unix/threadpsx.cpp +++ b/src/unix/threadpsx.cpp @@ -101,7 +101,17 @@ public: wxMutex::wxMutex() { p_internal = new wxMutexInternal; + +#if 0 + /* I don't know where this function is supposed to exist, + and NP actually means non-portable, RR. */ + pthread_mutexattr_t attr_type; + pthread_mutexattr_settype( &attr_type, PTHREAD_MUTEX_FAST_NP ); + + pthread_mutex_init( &(p_internal->p_mutex), (const pthread_mutexattr_t*) &attr_type ); +#else pthread_mutex_init( &(p_internal->p_mutex), (const pthread_mutexattr_t*) NULL ); +#endif m_locked = 0; } @@ -668,6 +678,9 @@ wxThreadError wxThread::Resume() wxThread::ExitCode wxThread::Delete() { + if (IsPaused()) + Resume(); + m_critsect.Enter(); wxThreadState state = p_internal->GetState(); @@ -693,6 +706,8 @@ wxThread::ExitCode wxThread::Delete() // wait until the thread stops p_internal->Wait(); } + //GL: As we must auto-destroy, the destruction must happen here. + delete this; return NULL; } @@ -714,6 +729,8 @@ wxThreadError wxThread::Kill() return wxTHREAD_MISC_ERROR; } + //GL: As we must auto-destroy, the destruction must happen here (2). + delete this; return wxTHREAD_NO_ERROR; }