Add support for acquiring multiple locks at once (#958)

* Add ASLocking which supports -tryLock and taking multiple locks safely

* Better multi locking

* Assert about lock set capacity
This commit is contained in:
Adlai Holler
2018-06-05 12:31:30 -07:00
committed by GitHub
parent 9214e3c2ef
commit 35d59acd83
13 changed files with 209 additions and 46 deletions

View File

@@ -17,6 +17,7 @@
#import <AsyncDisplayKit/ASLayoutElement.h>
#import <AsyncDisplayKit/ASAsciiArtBoxCreator.h>
#import <AsyncDisplayKit/ASLocking.h>
#import <AsyncDisplayKit/ASObjectDescriptionHelpers.h>
NS_ASSUME_NONNULL_BEGIN
@@ -24,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
* A layout spec is an immutable object that describes a layout, loosely inspired by React.
*/
@interface ASLayoutSpec : NSObject <ASLayoutElement, ASLayoutElementStylability, NSFastEnumeration, ASDescriptionProvider, NSLocking>
@interface ASLayoutSpec : NSObject <ASLayoutElement, ASLayoutElementStylability, NSFastEnumeration, ASDescriptionProvider, ASLocking>
/**
* Creation of a layout spec should only happen by a user in layoutSpecThatFits:. During that method, a