From f2912ecb4805d77359c73c5be418736ae76f6ffd Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Sun, 15 Jul 2018 19:57:12 -0700 Subject: [PATCH] Update lock-checking flag logic (#1032) --- Source/Details/ASThread.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Details/ASThread.h b/Source/Details/ASThread.h index 362f96c5b..3ebf40654 100644 --- a/Source/Details/ASThread.h +++ b/Source/Details/ASThread.h @@ -106,7 +106,7 @@ ASDISPLAYNODE_INLINE void _ASUnlockScopeCleanup(id __strong *lockPtr) #define TIME_LOCKER 0 /** * Enable this flag to collect information on the owning thread and ownership level of a mutex. - * These properties are useful to determine if a mutext has been acquired and in case of a recursive mutex, how many times that happened. + * These properties are useful to determine if a mutex has been acquired and in case of a recursive mutex, how many times that happened. * * This flag also enable locking assertions (e.g ASAssertUnlocked(node)). * The assertions are useful when you want to indicate and enforce the locking policy/expectation of methods. @@ -114,7 +114,11 @@ ASDISPLAYNODE_INLINE void _ASUnlockScopeCleanup(id __strong *lockPtr) * put breakpoints at some assertions. When the breakpoints hit, walk through stack trace frames * and check ownership count of the mutex. */ +#if ASDISPLAYNODE_ASSERTIONS_ENABLED #define CHECK_LOCKING_SAFETY 1 +#else +#define CHECK_LOCKING_SAFETY 0 +#endif #if TIME_LOCKER #import