X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/6b200bc335dc93c5516ccb52f14bd896d8c7fad7..7e6b461318c8a779d91381531435a68ee4e8b6ed:/OSX/libsecurity_utilities/lib/seccfobject.h?ds=sidebyside diff --git a/OSX/libsecurity_utilities/lib/seccfobject.h b/OSX/libsecurity_utilities/lib/seccfobject.h index dd593883..29e9a5d3 100644 --- a/OSX/libsecurity_utilities/lib/seccfobject.h +++ b/OSX/libsecurity_utilities/lib/seccfobject.h @@ -29,6 +29,7 @@ #include #include #include "threading.h" +#include #if( __cplusplus <= 201103L) #include @@ -45,7 +46,9 @@ operator APIPTR() const \ \ OBJTYPE *retain() \ { SecCFObject::handle(true); return this; } \ -APIPTR handle(bool retain = true) \ +APIPTR CF_RETURNS_RETAINED handle() \ +{ return (APIPTR)SecCFObject::handle(true); } \ +APIPTR handle(bool retain) \ { return (APIPTR)SecCFObject::handle(retain); } #define SECCFFUNCTIONS_CREATABLE(OBJTYPE, APIPTR, CFCLASS) \ @@ -82,7 +85,7 @@ private: static const size_t kAlignedRuntimeSize = SECALIGNUP(sizeof(SecRuntimeBase), 4); uint32_t mRetainCount; - OSSpinLock mRetainSpinLock; + os_unfair_lock mRetainLock; public: // For use by SecPointer only. Returns true once the first time it's called after the object has been created.