X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/fa7225c82381bac4432a6edf16f53b5370238d85..refs/heads/master:/OSX/libsecurity_utilities/lib/globalizer.h diff --git a/OSX/libsecurity_utilities/lib/globalizer.h b/OSX/libsecurity_utilities/lib/globalizer.h index aa733560..db0e20ff 100644 --- a/OSX/libsecurity_utilities/lib/globalizer.h +++ b/OSX/libsecurity_utilities/lib/globalizer.h @@ -33,6 +33,7 @@ #include #include #include +#include namespace Security { @@ -46,10 +47,10 @@ class GlobalNexus { public: class Error : public std::exception { public: - virtual ~Error() throw(); + virtual ~Error() _NOEXCEPT; const char * const message; Error(const char *m) : message(m) { } - const char *what() const throw() { return message; } + const char *what() const _NOEXCEPT { return message; } }; }; @@ -60,14 +61,14 @@ private: protected: void *create(void *(*make)()); - void lock() {OSSpinLockLock(&access);} - void unlock() {OSSpinLockUnlock(&access);} + void lock() {os_unfair_lock_lock(&access);} + void unlock() {os_unfair_lock_unlock(&access);} protected: // all of these will be statically initialized to zero void *pointer; dispatch_once_t once; - OSSpinLock access; + os_unfair_lock access; }; template