Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Need Design Review] Set up an experiment to share one lock across each entire embedding #1528

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions AsyncDisplayKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@
CC0F88631E4281E700576FED /* ASSupplementaryNodeSource.h in Headers */ = {isa = PBXBuildFile; fileRef = CCE04B2B1E314A32006AEBBB /* ASSupplementaryNodeSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
CC0F886C1E4286FA00576FED /* ReferenceImages_64 in Resources */ = {isa = PBXBuildFile; fileRef = CC0F88691E4286FA00576FED /* ReferenceImages_64 */; };
CC0F886D1E4286FA00576FED /* ReferenceImages_iOS_10 in Resources */ = {isa = PBXBuildFile; fileRef = CC0F886A1E4286FA00576FED /* ReferenceImages_iOS_10 */; };
CC1122C5229F79320061BD2C /* ASNodeContext.h in Headers */ = {isa = PBXBuildFile; fileRef = CC1122C3229F79320061BD2C /* ASNodeContext.h */; settings = {ATTRIBUTES = (Public, ); }; };
CC1122C6229F79320061BD2C /* ASNodeContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = CC1122C4229F79320061BD2C /* ASNodeContext.mm */; };
CC1122C9229F7C990061BD2C /* ASNodeContext+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = CC1122C8229F7C990061BD2C /* ASNodeContext+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
CC11F97A1DB181180024D77B /* ASNetworkImageNodeTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = CC11F9791DB181180024D77B /* ASNetworkImageNodeTests.mm */; };
CC18248C200D49C800875940 /* ASTextNodeCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = CC18248B200D49C800875940 /* ASTextNodeCommon.h */; settings = {ATTRIBUTES = (Public, ); }; };
CC224E962066CA6D00BBA57F /* configuration.json in Resources */ = {isa = PBXBuildFile; fileRef = CC224E952066CA6D00BBA57F /* configuration.json */; };
Expand All @@ -361,6 +364,7 @@
CC3B208C1C3F7A5400798563 /* ASWeakSet.mm in Sources */ = {isa = PBXBuildFile; fileRef = CC3B20881C3F7A5400798563 /* ASWeakSet.mm */; };
CC3B208E1C3F7D0A00798563 /* ASWeakSetTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = CC3B208D1C3F7D0A00798563 /* ASWeakSetTests.mm */; };
CC3B20901C3F892D00798563 /* ASBridgedPropertiesTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = CC3B208F1C3F892D00798563 /* ASBridgedPropertiesTests.mm */; };
CC3F59C022CAACAD002C3824 /* ASNodeContextTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = CC3F59BF22CAACAD002C3824 /* ASNodeContextTests.mm */; };
CC4981B31D1A02BE004E13CC /* ASTableViewThrashTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = CC4981B21D1A02BE004E13CC /* ASTableViewThrashTests.mm */; };
CC54A81C1D70079800296A24 /* ASDispatch.h in Headers */ = {isa = PBXBuildFile; fileRef = CC54A81B1D70077A00296A24 /* ASDispatch.h */; settings = {ATTRIBUTES = (Private, ); }; };
CC54A81E1D7008B300296A24 /* ASDispatchTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = CC54A81D1D7008B300296A24 /* ASDispatchTests.mm */; };
Expand Down Expand Up @@ -862,6 +866,9 @@
CC0F885E1E4280B800576FED /* _ASCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _ASCollectionViewCell.h; sourceTree = "<group>"; };
CC0F88691E4286FA00576FED /* ReferenceImages_64 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ReferenceImages_64; sourceTree = "<group>"; };
CC0F886A1E4286FA00576FED /* ReferenceImages_iOS_10 */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ReferenceImages_iOS_10; sourceTree = "<group>"; };
CC1122C3229F79320061BD2C /* ASNodeContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASNodeContext.h; sourceTree = "<group>"; };
CC1122C4229F79320061BD2C /* ASNodeContext.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ASNodeContext.mm; sourceTree = "<group>"; };
CC1122C8229F7C990061BD2C /* ASNodeContext+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ASNodeContext+Private.h"; sourceTree = "<group>"; };
CC11F9791DB181180024D77B /* ASNetworkImageNodeTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASNetworkImageNodeTests.mm; sourceTree = "<group>"; };
CC18248B200D49C800875940 /* ASTextNodeCommon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASTextNodeCommon.h; sourceTree = "<group>"; };
CC224E952066CA6D00BBA57F /* configuration.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = configuration.json; sourceTree = "<group>"; };
Expand All @@ -884,6 +891,7 @@
CC3B20881C3F7A5400798563 /* ASWeakSet.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASWeakSet.mm; sourceTree = "<group>"; };
CC3B208D1C3F7D0A00798563 /* ASWeakSetTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASWeakSetTests.mm; sourceTree = "<group>"; };
CC3B208F1C3F892D00798563 /* ASBridgedPropertiesTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = ASBridgedPropertiesTests.mm; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
CC3F59BF22CAACAD002C3824 /* ASNodeContextTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ASNodeContextTests.mm; sourceTree = "<group>"; };
CC4981B21D1A02BE004E13CC /* ASTableViewThrashTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASTableViewThrashTests.mm; sourceTree = "<group>"; };
CC4981BA1D1C7F65004E13CC /* NSIndexSet+ASHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSIndexSet+ASHelpers.h"; sourceTree = "<group>"; };
CC4981BB1D1C7F65004E13CC /* NSIndexSet+ASHelpers.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSIndexSet+ASHelpers.mm"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1237,6 +1245,8 @@
CCED5E3D2020D36800395C40 /* ASNetworkImageLoadInfo.mm */,
055B9FA61A1C154B00035D6D /* ASNetworkImageNode.h */,
055B9FA71A1C154B00035D6D /* ASNetworkImageNode.mm */,
CC1122C3229F79320061BD2C /* ASNodeContext.h */,
CC1122C4229F79320061BD2C /* ASNodeContext.mm */,
698371D91E4379CD00437585 /* ASNodeController+Beta.h */,
698371DA1E4379CD00437585 /* ASNodeController+Beta.mm */,
DBDB83921C6E879900D0098C /* ASPagerFlowLayout.h */,
Expand Down Expand Up @@ -1345,6 +1355,7 @@
058D0A32195D057000B7D73C /* ASMutableAttributedStringBuilderTests.mm */,
BB5FC3CD1F9BA688007F191E /* ASNavigationControllerTests.mm */,
CC11F9791DB181180024D77B /* ASNetworkImageNodeTests.mm */,
CC3F59BF22CAACAD002C3824 /* ASNodeContextTests.mm */,
ACF6ED591B178DC700DA7C62 /* ASOverlayLayoutSpecSnapshotTests.mm */,
AE6987C01DD04E1000B9E458 /* ASPagerNodeTests.mm */,
CC8B05D41D73836400F54286 /* ASPerformanceTestContext.h */,
Expand Down Expand Up @@ -1553,6 +1564,7 @@
CC2F65EC1E5FFB1600DA57C9 /* ASMutableElementMap.h */,
CC2F65ED1E5FFB1600DA57C9 /* ASMutableElementMap.mm */,
CCED5E402020D41600395C40 /* ASNetworkImageLoadInfo+Private.h */,
CC1122C8229F7C990061BD2C /* ASNodeContext+Private.h */,
CC3B20811C3F76D600798563 /* ASPendingStateController.h */,
CC3B20821C3F76D600798563 /* ASPendingStateController.mm */,
CC55A70F1E52A0F200594372 /* ASResponderChainEnumerator.h */,
Expand Down Expand Up @@ -1931,7 +1943,9 @@
A2763D7A1CBDD57D00A9ADBD /* ASPINRemoteImageDownloader.h in Headers */,
C018DF21216BF26700181FDA /* ASAbstractLayoutController+FrameworkPrivate.h in Headers */,
34EFC7611B701C9C00AD841F /* ASBackgroundLayoutSpec.h in Headers */,
CC1122C5229F79320061BD2C /* ASNodeContext.h in Headers */,
B35062591B010F070018CF92 /* ASBaseDefines.h in Headers */,
CC1122C9229F7C990061BD2C /* ASNodeContext+Private.h in Headers */,
B35062131B010EFD0018CF92 /* ASBasicImageDownloader.h in Headers */,
B35062151B010EFD0018CF92 /* ASBatchContext.h in Headers */,
B35061F31B010EFD0018CF92 /* ASCellNode.h in Headers */,
Expand Down Expand Up @@ -2342,6 +2356,7 @@
254C6B541BF8FF2A003EC431 /* ASTextKitTests.mm in Sources */,
05EA6FE71AC0966E00E35788 /* ASSnapshotTestCase.mm in Sources */,
CC35CEC620DD87280006448D /* ASCollectionsTests.mm in Sources */,
CC3F59C022CAACAD002C3824 /* ASNodeContextTests.mm in Sources */,
ACF6ED631B178DC700DA7C62 /* ASStackLayoutSpecSnapshotTests.mm in Sources */,
CCE4F9BA1F0DBB5000062E4E /* ASLayoutTestNode.mm in Sources */,
CCAA0B82206ADECB0057B336 /* ASRecursiveUnfairLockTests.mm in Sources */,
Expand Down Expand Up @@ -2524,6 +2539,7 @@
254C6B871BF94F8A003EC431 /* ASTextKitEntityAttribute.mm in Sources */,
34566CB31BC1213700715E6B /* ASPhotosFrameworkImageRequest.mm in Sources */,
254C6B831BF94F8A003EC431 /* ASTextKitCoreTextAdditions.mm in Sources */,
CC1122C6229F79320061BD2C /* ASNodeContext.mm in Sources */,
CCCCCCE21EC3EF060087FE10 /* ASTextUtilities.mm in Sources */,
CC55A70E1E529FA200594372 /* UIResponder+AsyncDisplayKit.mm in Sources */,
CC56013C1F06E9A700DC4FBE /* ASIntegerMap.mm in Sources */,
Expand Down
2 changes: 2 additions & 0 deletions Source/ASDisplayNode+Layout.mm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#import <AsyncDisplayKit/ASDisplayNode+Yoga.h>
#import <AsyncDisplayKit/NSArray+Diffing.h>

#define __instanceLock__ _mutexOrPtr.get()

using AS::MutexLocker;

@interface ASDisplayNode (ASLayoutElementStyleDelegate) <ASLayoutElementStyleDelegate>
Expand Down
1 change: 1 addition & 0 deletions Source/ASDisplayNode+LayoutSpec.mm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#import <AsyncDisplayKit/ASLog.h>
#import <AsyncDisplayKit/ASThread.h>

#define __instanceLock__ _mutexOrPtr.get()

@implementation ASDisplayNode (ASLayoutSpec)

Expand Down
3 changes: 3 additions & 0 deletions Source/ASDisplayNode+Yoga.mm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

#import <AsyncDisplayKit/ASDisplayNode+LayoutSpec.h>

#define __instanceLock__ _mutexOrPtr.get()

#define YOGA_LAYOUT_LOGGING 0

#pragma mark - ASDisplayNode+Yoga
Expand Down Expand Up @@ -107,6 +109,7 @@ - (void)_locked_insertYogaChild:(ASDisplayNode *)child atIndex:(NSUInteger)index
if (child == nil) {
return;
}
ASDisplayNodeAssert(_nodeContext == child->_nodeContext, @"Cannot add yoga child from different node context.");
if (_yogaChildren == nil) {
_yogaChildren = [[NSMutableArray alloc] init];
}
Expand Down
8 changes: 6 additions & 2 deletions Source/ASDisplayNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
#define AS_MAX_INTERFACE_STATE_DELEGATES 4
#endif

@class ASDisplayNode;
@class ASDisplayNode, ASNodeContext;
@protocol ASContextTransitioning;

/**
Expand Down Expand Up @@ -115,7 +115,6 @@ AS_EXTERN NSInteger const ASDefaultDrawingPriority;
*/
- (instancetype)init NS_DESIGNATED_INITIALIZER;


/**
* @abstract Alternative initializer with a block to create the backing view.
*
Expand Down Expand Up @@ -191,6 +190,11 @@ AS_EXTERN NSInteger const ASDefaultDrawingPriority;
*/
- (void)setLayerBlock:(ASDisplayNodeLayerBlock)layerBlock;

/**
* Get the context for this node, if one was set during creation.
*/
@property (nullable, readonly) ASNodeContext *nodeContext;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to expose the nodeContext publicly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To your question above, if users want to implement custom containers, and they want to add new nodes to a given context outside of our automatic places (like layout) they will need to push the context for an existing node. At least that's my thinking although I haven't written out an example case yet.


/**
* @abstract Returns whether the node is synchronous.
*
Expand Down
15 changes: 14 additions & 1 deletion Source/ASDisplayNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
// TODO(wsdwsd0829): Rework enabling code to ensure that interface state behavior is not altered when ASCATransactionQueue is disabled.
#define ENABLE_NEW_EXIT_HIERARCHY_BEHAVIOR 0

/**
* A temporary convenience macro during the transition from __instanceLock__ to context-or-instance lock.
* A diff will come soon with a massive find-and-replace.
*/
#define __instanceLock__ _mutexOrPtr.get()

using AS::MutexLocker;

static ASDisplayNodeNonFatalErrorBlock _nonFatalErrorBlock = nil;
Expand Down Expand Up @@ -296,7 +302,13 @@ - (void)_staticInitialize
- (void)_initializeInstance
{
[self _staticInitialize];
__instanceLock__.SetDebugNameWithObject(self);
_nodeContext = ASNodeContextGet();
if (_nodeContext) {
new (&_mutexOrPtr) AS::MutexOrPointer(&_nodeContext->_mutex);
} else {
new (&_mutexOrPtr) AS::MutexOrPointer(nullptr);
_mutexOrPtr.get().SetDebugNameWithObject(self);
}

_viewClass = [self.class viewClass];
_layerClass = [self.class layerClass];
Expand Down Expand Up @@ -2040,6 +2052,7 @@ - (void)_insertSubnode:(ASDisplayNode *)subnode atSubnodeIndex:(NSInteger)subnod
ASDisplayNodeAssertThreadAffinity(self);
// TODO: Disabled due to PR: https://github.com/TextureGroup/Texture/pull/1204
DISABLED_ASAssertUnlocked(__instanceLock__);
ASDisplayNodeAssert(subnode->_nodeContext == _nodeContext, @"Cannot mix nodes from different contexts.");

as_log_verbose(ASNodeLog(), "Insert subnode %@ at index %zd of %@ and remove subnode %@", subnode, subnodeIndex, self, oldSubnode);

Expand Down
2 changes: 2 additions & 0 deletions Source/ASImageNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
// TODO: It would be nice to remove this dependency; it's the only subclass using more than +FrameworkSubclasses.h
#import <AsyncDisplayKit/ASDisplayNodeInternal.h>

#define __instanceLock__ _mutexOrPtr.get()

static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0};

typedef void (^ASImageNodeDrawParametersBlock)(ASWeakMapEntry *entry);
Expand Down
67 changes: 67 additions & 0 deletions Source/ASNodeContext.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//
// ASNodeContext.h
// Texture
//
// Copyright (c) Pinterest, Inc. All rights reserved.
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0

#import <Foundation/Foundation.h>

#import <AsyncDisplayKit/AsyncDisplayKit.h>

NS_ASSUME_NONNULL_BEGIN

@class ASNodeContext;

/**
* Push the given context, which will apply to any nodes initialized until the corresponding `pop`.
*
* Generally each cell in a collection or table, and the root of an ASViewController, will be a context.
*/
AS_EXTERN void ASNodeContextPush(unowned ASNodeContext *context);

/**
* Get the current top context, if there is one.
*/
AS_EXTERN ASNodeContext *_Nullable ASNodeContextGet(void);

/**
* Pop the current context, matching a previous call to ASNodeContextPush.
*/
AS_EXTERN void ASNodeContextPop(void);

/**
* A convenience to perform the given block with the provided context active.
*/
AS_EXTERN id ASNodeContextPerform(unowned ASNodeContext *ctx, id (^NS_NOESCAPE body)(void));

/**
* Node contexts can have extensions attached to them. For instance, if your application wants to do custom logging
* on a per-context basis, you can define an extension identifier (pick an arbitrary uint32_t that won't collide)
* and the logger can be stored & retrieved from the node context.
*/
typedef uint32_t ASNodeContextExtensionIdentifier NS_TYPED_EXTENSIBLE_ENUM;

/**
* A node context is an object that is shared by, and uniquely identifies, an "embedding" of nodes. For example,
* each cell in a collection view has its own context. Each ASViewController's node has its own context. You can
* also explicitly establish a context for a node tree in another context.
*
* Node contexts store the mutex that is shared by all member nodes for synchronization. Operations such as addSubnode:
* will lock the context's mutex for the duration of the work.
*
* Nodes may not be moved from one context to another. For instance, you may not detach a subnode of a cell node,
* and reattach it to a subtree of another cell node in the same or another collection view.
*/
AS_SUBCLASSING_RESTRICTED
@interface ASNodeContext : NSObject <ASLocking>

#pragma mark - Extension

- (nullable id)extensionWithIdentifier:(ASNodeContextExtensionIdentifier)extensionIdentifier;

- (void)setExtension:(nullable id)extension forIdentifier:(ASNodeContextExtensionIdentifier)extensionIdentifier;

@end

NS_ASSUME_NONNULL_END
113 changes: 113 additions & 0 deletions Source/ASNodeContext.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
//
// ASNodeContext.mm
// Texture
//
// Copyright (c) Pinterest, Inc. All rights reserved.
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0

#import <AsyncDisplayKit/ASNodeContext+Private.h>

#import <AsyncDisplayKit/ASAssert.h>

#import <stack>
#import <unordered_map>

#if AS_TLS_AVAILABLE

static thread_local std::stack<ASNodeContext *> gContexts;

void ASNodeContextPush(unowned ASNodeContext *context) {
gContexts.push(context);
}

ASNodeContext *ASNodeContextGet() {
Adlai-Holler marked this conversation as resolved.
Show resolved Hide resolved
return gContexts.empty() ? nil : gContexts.top();
}

void ASNodeContextPop() {
if (DISPATCH_EXPECT(gContexts.empty(), false)) {
ASDisplayNodeCFailAssert(@"Attempt to pop empty context stack.");
return;
}
gContexts.pop();
}

#else // !AS_TLS_AVAILABLE

// Only on 32-bit simulator. Performance expendable.

// Points to a NSMutableArray<ASNodeContext *>.
static constexpr NSString *ASNodeContextStackKey = @"org.TextureGroup.Texture.nodeContexts";

void ASNodeContextPush(unowned ASNodeContext *context) {
unowned NSMutableDictionary *td = NSThread.currentThread.threadDictionary;
unowned NSMutableArray<ASNodeContext *> *stack = td[ASNodeContextStackKey];
if (!stack) {
td[ASNodeContextStackKey] = [[NSMutableArray alloc] initWithObjects:context, nil];
} else {
[stack addObject:context];
}
}

ASNodeContext *ASNodeContextGet() {
return [NSThread.currentThread.threadDictionary[ASNodeContextStackKey] lastObject];
}

void ASNodeContextPop() {
if (ASActivateExperimentalFeature(ASExperimentalNodeContext)) {
[NSThread.currentThread.threadDictionary[ASNodeContextStackKey] removeLastObject];
}
}

#endif // !AS_TLS_AVAILABLE

id ASNodeContextPerform(unowned ASNodeContext *ctx, id(^ NS_NOESCAPE body)(void))
{
ASNodeContextPush(ctx);
id result = body();
ASNodeContextPop();
return result;
}

@implementation ASNodeContext {
std::unordered_map<uint32_t, id> _extensions;
}

- (id)createObject:(id(^ NS_NOESCAPE)())body
{
ASNodeContextPush(self);
id result = body();
ASNodeContextPop();
return result;
}

- (instancetype)init
{
if (self = [super init]) {
_mutex.SetDebugNameWithObject(self);
}
return self;
}

- (id)extensionWithIdentifier:(ASNodeContextExtensionIdentifier)extensionIdentifier
{
AS::MutexLocker l(_mutex);
auto it = _extensions.find(extensionIdentifier);
return it != _extensions.end() ? it->second : nil;
}

- (void)setExtension:(id)extension forIdentifier:(ASNodeContextExtensionIdentifier)extensionIdentifier
{
AS::MutexLocker l(_mutex);
if (extension) {
_extensions.emplace(extensionIdentifier, extension);
} else {
_extensions.erase(extensionIdentifier);
}
}

#pragma mark ASLocking

ASSynthesizeLockingMethodsWithMutex(_mutex);

@end
2 changes: 2 additions & 0 deletions Source/ASNodeController+Beta.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
// Until an ASNodeController can be provided in place of an ASCellNode, some apps may prefer to have
// nodes keep their controllers alive (and a weak reference from controller to node)

@property (readonly) ASNodeContext *nodeContext;

@property (nonatomic) BOOL shouldInvertStrongReference;

- (void)loadNode;
Expand Down
Loading