#include <objc/objc-sync.h>

objc/objc-sync.h

includes: objc/objc.h
2 functions · 1 enum

functionobjc_sync_enter

OBJC_AVAILABLE(10.3, 2.0, 9.0, 1.0, 2.0)
OBJC_EXPORT int objc_sync_enter(id _Nonnull obj)
Begin synchronizing on 'obj'. Allocates recursive pthread_mutex associated with 'obj' if needed. @param obj The object to begin synchronizing on. @return OBJC_SYNC_SUCCESS once lock is acquired.

functionobjc_sync_exit

OBJC_AVAILABLE(10.3, 2.0, 9.0, 1.0, 2.0)
OBJC_EXPORT int objc_sync_exit(id _Nonnull obj)
End synchronizing on 'obj'. @param obj The object to end synchronizing on. @return OBJC_SYNC_SUCCESS or OBJC_SYNC_NOT_OWNING_THREAD_ERROR

enum(anonymous)

underlying type int
OBJC_SYNC_SUCCESS0
OBJC_SYNC_NOT_OWNING_THREAD_ERROR-1