]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_utilities/lib/globalizer.h
Security-59306.61.1.tar.gz
[apple/security.git] / OSX / libsecurity_utilities / lib / globalizer.h
index 66480469f94e40e2ca247f9038cd836953a7f061..5610cc8aaf7965ee93f9c8dec5dae71dd4fe81b5 100644 (file)
@@ -33,6 +33,7 @@
 #include <set>
 #include <dispatch/dispatch.h>
 #include <libkern/OSAtomic.h>
 #include <set>
 #include <dispatch/dispatch.h>
 #include <libkern/OSAtomic.h>
+#include <os/lock.h>
 
 namespace Security {
 
 
 namespace Security {
 
@@ -60,14 +61,14 @@ private:
 
 protected:
     void *create(void *(*make)());
 
 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;
 
 protected:
     // all of these will be statically initialized to zero
        void *pointer;
     dispatch_once_t once;
-    OSSpinLock access;
+    os_unfair_lock access;
 };
 
 template <class Type>
 };
 
 template <class Type>
@@ -127,7 +128,7 @@ class CleanModuleNexus : public ModuleNexus<Type> {
 public:
     ~CleanModuleNexus()
     {
 public:
     ~CleanModuleNexus()
     {
-        secdebug("nexus", "ModuleNexus %p destroyed object 0x%x",
+        secinfo("nexus", "ModuleNexus %p destroyed object 0x%x",
                        this, ModuleNexus<Type>::pointer);
         delete reinterpret_cast<Type *>(ModuleNexus<Type>::pointer);
     }
                        this, ModuleNexus<Type>::pointer);
         delete reinterpret_cast<Type *>(ModuleNexus<Type>::pointer);
     }