Skip to content

Commit

Permalink
Update lock-checking flag logic (TextureGroup#1032)
Browse files Browse the repository at this point in the history
  • Loading branch information
Adlai-Holler authored and mikezucc committed Oct 2, 2018
1 parent fbd75e5 commit e6e1170
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Source/Details/ASThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,19 @@ ASDISPLAYNODE_INLINE void _ASUnlockScopeCleanup(id<NSLocking> __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.
* To determine when and which methods acquired a (recursive) mutex (to debug deadlocks, for example),
* 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 <QuartzCore/QuartzCore.h>
Expand Down

0 comments on commit e6e1170

Please sign in to comment.