From ed197fcf1572ba922802aaaa46e9f7970ea14bed Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sun, 16 May 2004 19:32:01 +0000 Subject: [PATCH] adding MPYield after releasing constructs like critical regions etc. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27314 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/thread.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mac/carbon/thread.cpp b/src/mac/carbon/thread.cpp index c4fc7e90f9..289a8fa35e 100644 --- a/src/mac/carbon/thread.cpp +++ b/src/mac/carbon/thread.cpp @@ -130,8 +130,8 @@ MPCriticalRegionID gs_guiCritical = kInvalidID; #if TARGET_API_MAC_OSX #define wxUSE_MAC_SEMAPHORE_MUTEX 0 -#define wxUSE_MAC_CRITICAL_REGION_MUTEX 0 -#define wxUSE_MAC_PTHREADS_MUTEX 1 +#define wxUSE_MAC_CRITICAL_REGION_MUTEX 1 +#define wxUSE_MAC_PTHREADS_MUTEX 0 #else #define wxUSE_MAC_SEMAPHORE_MUTEX 0 #define wxUSE_MAC_CRITICAL_REGION_MUTEX 1 @@ -347,6 +347,7 @@ wxMutexInternal::~wxMutexInternal() { if ( m_semaphore != kInvalidID ) MPDeleteSemaphore( m_semaphore); + MPYield() ; } wxMutexError wxMutexInternal::Lock() @@ -383,12 +384,12 @@ wxMutexError wxMutexInternal::Unlock() { wxCHECK_MSG( m_isOk , wxMUTEX_MISC_ERROR , wxT("Invalid Mutex") ) ; OSStatus err = MPSignalSemaphore( m_semaphore); + MPYield() ; if ( err) { wxLogSysError(_("Could not unlock mutex")); return wxMUTEX_MISC_ERROR; } - return wxMUTEX_NO_ERROR; } @@ -427,6 +428,7 @@ wxMutexInternal::~wxMutexInternal() { if ( m_critRegion != kInvalidID ) MPDeleteCriticalRegion( m_critRegion); + MPYield() ; } wxMutexError wxMutexInternal::Lock() @@ -463,6 +465,7 @@ wxMutexError wxMutexInternal::Unlock() { wxCHECK_MSG( m_isOk , wxMUTEX_MISC_ERROR , wxT("Invalid Mutex") ) ; OSStatus err = MPExitCriticalRegion( m_critRegion); + MPYield() ; if ( err) { wxLogSysError(_("Could not unlock mutex")); @@ -524,6 +527,7 @@ wxSemaphoreInternal::~wxSemaphoreInternal() { if( m_semaphore != kInvalidID ) MPDeleteSemaphore( m_semaphore); + MPYield() ; } wxSemaError wxSemaphoreInternal::WaitTimeout(unsigned long milliseconds) @@ -543,6 +547,7 @@ wxSemaError wxSemaphoreInternal::WaitTimeout(unsigned long milliseconds) wxSemaError wxSemaphoreInternal::Post() { OSStatus err = MPSignalSemaphore( m_semaphore); + MPYield() ; if ( err) { return wxSEMA_MISC_ERROR; -- 2.47.2