From ad9213b694902d0698911ed1212efca984ee8ab3 Mon Sep 17 00:00:00 2001 From: mread Date: Tue, 8 Mar 2011 11:06:47 +0000 Subject: 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 --- .../benchmarks/corelib/thread/qmutex/tst_qmutex.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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 -#ifdef Q_OS_UNIX +#ifdef Q_OS_SYMBIAN +# include +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 # include typedef pthread_mutex_t NativeMutexType; -- cgit v0.12