summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qmutex_p.h
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2011-10-21 07:59:54 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2011-10-21 08:57:42 (GMT)
commit0375fff2b077ddd20a97c1b1c8d34f22553abe0c (patch)
treee865f2a984fc29d3a428a0121a893a2c8f00dd84 /src/corelib/thread/qmutex_p.h
parent2df43004a5c093879371574cfe9ea3f68fefa69c (diff)
downloadQt-0375fff2b077ddd20a97c1b1c8d34f22553abe0c.zip
Qt-0375fff2b077ddd20a97c1b1c8d34f22553abe0c.tar.gz
Qt-0375fff2b077ddd20a97c1b1c8d34f22553abe0c.tar.bz2
Fix performance regression on Mac OS X when creating/destroying QMutex
This reverts commit cf17b743d2fe84ab259b7232ab07b58a1872e18e, which changed QMutex to use a Mach semaphore_t on Mac OS X. We now use pthread_mutex_t on Mac OS X as well. Contention performance is mostly unchanged, but the new constructionQMutex() benchmark added in this commit shows that creating/destroying a semaphore_t is about 20 times slower than pthread_mutex_t. Reviewed-by: Olivier Goffart Reviewed-by: João Abecasis
Diffstat (limited to 'src/corelib/thread/qmutex_p.h')
-rw-r--r--src/corelib/thread/qmutex_p.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/corelib/thread/qmutex_p.h b/src/corelib/thread/qmutex_p.h
index a9923c4..d2ffd28 100644
--- a/src/corelib/thread/qmutex_p.h
+++ b/src/corelib/thread/qmutex_p.h
@@ -58,10 +58,6 @@
#include <QtCore/qnamespace.h>
#include <QtCore/qmutex.h>
-#if defined(Q_OS_MAC)
-# include <mach/semaphore.h>
-#endif
-
#if defined(Q_OS_SYMBIAN)
# include <e32std.h>
#endif
@@ -83,9 +79,7 @@ public:
Qt::HANDLE owner;
uint count;
-#if defined(Q_OS_MAC)
- semaphore_t mach_semaphore;
-#elif defined(Q_OS_UNIX) && !defined(Q_OS_LINUX) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_LINUX) && !defined(Q_OS_SYMBIAN)
volatile bool wakeup;
pthread_mutex_t mutex;
pthread_cond_t cond;