diff options
author | 2015-01-23 00:46:41 -0800 | |
---|---|---|
committer | 2015-01-23 00:46:41 -0800 | |
commit | 2bab15f431bec4ba5f10238e6f578ab2653ea675 (patch) | |
tree | 3dd78f995fb1f801e3f57fc019da1f8200c244ab /src/core/basetypes/MCObject.h | |
parent | d45ce14d841e6555bf0b524cee12aa111155ffab (diff) |
Use spinlock
Diffstat (limited to 'src/core/basetypes/MCObject.h')
-rw-r--r-- | src/core/basetypes/MCObject.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/basetypes/MCObject.h b/src/core/basetypes/MCObject.h index 95446f61..83d6c1a7 100644 --- a/src/core/basetypes/MCObject.h +++ b/src/core/basetypes/MCObject.h @@ -5,6 +5,7 @@ #include <pthread.h> #if __APPLE__ #include <dispatch/dispatch.h> +#include <libkern/OSAtomic.h> #endif #include <MailCore/MCUtils.h> @@ -56,7 +57,11 @@ namespace mailcore { public: // private private: +#if __APPLE__ + OSSpinLock mLock; +#else pthread_mutex_t mLock; +#endif int mCounter; void init(); static void initObjectConstructors(); |