summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormread <qt-info@nokia.com>2011-03-08 11:06:47 (GMT)
committermread <qt-info@nokia.com>2011-03-09 12:48:51 (GMT)
commitad9213b694902d0698911ed1212efca984ee8ab3 (patch)
tree21611800fa6548cbfeb664990227a9eaa64dca23
parentef4b63c5d9424f82c17ebe614873e4205af0deb9 (diff)
downloadQt-ad9213b694902d0698911ed1212efca984ee8ab3.zip
Qt-ad9213b694902d0698911ed1212efca984ee8ab3.tar.gz
Qt-ad9213b694902d0698911ed1212efca984ee8ab3.tar.bz2
Using Symbian native mutex type in tst_bench_qmutex
The QMutex benchmark contains benchmarks for the native mutex type. It was using pthread_mutex_t on Symbian, which isn't the true native mutex type and so isn't really representative of true native performance. Now it uses RMutex. Task-number: QTBUG-13990 Reviewed-by: Shane Kearns
-rw-r--r--tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp b/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp
index b0c5702..468096d 100644
--- a/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp
+++ b/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp
@@ -44,7 +44,26 @@
#include <math.h>
-#ifdef Q_OS_UNIX
+#ifdef Q_OS_SYMBIAN
+# include <e32std.h>
+typedef RMutex NativeMutexType;
+void NativeMutexInitialize(NativeMutexType *mutex)
+{
+ mutex->CreateLocal();
+}
+void NativeMutexDestroy(NativeMutexType *mutex)
+{
+ mutex->Close();
+}
+void NativeMutexLock(NativeMutexType *mutex)
+{
+ mutex->Wait();
+}
+void NativeMutexUnlock(NativeMutexType *mutex)
+{
+ mutex->Signal();
+}
+#elif defined(Q_OS_UNIX)
# include <pthread.h>
# include <errno.h>
typedef pthread_mutex_t NativeMutexType;