mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
[OSX] Use spinlocks instead of mutexes since mutexes are really semaphores, gives me a decent speed up.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5420 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -47,6 +47,10 @@
|
||||
#error unsupported platform (no pthreads?)
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <libkern/OSAtomic.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// Don't include common.h here as it will break LogManager
|
||||
@ -75,7 +79,11 @@ class CriticalSection
|
||||
CRITICAL_SECTION section;
|
||||
#else
|
||||
#ifdef _POSIX_THREADS
|
||||
pthread_mutex_t mutex;
|
||||
#ifdef __APPLE__
|
||||
OSSpinLock lock;
|
||||
#else
|
||||
pthread_mutex_t mutex;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
public:
|
||||
@ -197,9 +205,14 @@ private:
|
||||
|
||||
bool is_set_;
|
||||
#ifdef _POSIX_THREADS
|
||||
#ifdef __APPLE__
|
||||
OSSpinLock lock;
|
||||
u32 event_;
|
||||
#else
|
||||
pthread_cond_t event_;
|
||||
pthread_mutex_t mutex_;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
};
|
||||
|
Reference in New Issue
Block a user