diff --git a/Source/ASDisplayNode+Layout.mm b/Source/ASDisplayNode+Layout.mm index 592b18db9..02c9a0685 100644 --- a/Source/ASDisplayNode+Layout.mm +++ b/Source/ASDisplayNode+Layout.mm @@ -59,7 +59,7 @@ - (ASLayoutElementStyle *)style - (ASLayoutElementStyle *)_locked_style { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); if (_style == nil) { #if YOGA // In Yoga mode we use the delegate to inform the tree if properties changes @@ -210,7 +210,7 @@ - (ASSizeRange)constrainedSizeForCalculatedLayout - (ASSizeRange)_locked_constrainedSizeForCalculatedLayout { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); if (_pendingDisplayNodeLayout.isValid(_layoutVersion)) { return _pendingDisplayNodeLayout.constrainedSize; } @@ -246,7 +246,7 @@ @implementation ASDisplayNode (ASLayoutInternal) - (void)_u_setNeedsLayoutFromAbove { ASDisplayNodeAssertThreadAffinity(self); - ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); as_activity_create_for_scope("Set needs layout from above"); @@ -333,7 +333,7 @@ - (void)displayNodeDidInvalidateSizeNewSize:(CGSize)size - (void)_u_measureNodeWithBoundsIfNecessary:(CGRect)bounds { - // ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); ASScopedLockSelfOrToRoot(); // Check if we are a subnode in a layout transition. @@ -487,7 +487,7 @@ - (ASSizeRange)_locked_constrainedSizeForLayoutPass // logic seems correct. For what case does -this method need to do the CGSizeEqual checks? // IF WE CAN REMOVE BOUNDS CHECKS HERE, THEN WE CAN ALSO REMOVE "REQUESTED FROM ABOVE" CHECK - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); CGSize boundsSizeForLayout = ASCeilSizeValues(self.threadSafeBounds.size); @@ -513,7 +513,7 @@ - (ASSizeRange)_locked_constrainedSizeForLayoutPass - (void)_layoutSublayouts { ASDisplayNodeAssertThreadAffinity(self); - // ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); ASLayout *layout; { @@ -572,7 +572,7 @@ - (BOOL)_isLayoutTransitionInvalid - (BOOL)_locked_isLayoutTransitionInvalid { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); if (ASHierarchyStateIncludesLayoutPending(_hierarchyState)) { ASLayoutElementContext *context = ASLayoutElementGetCurrentContext(); if (context == nil || _pendingTransitionID != context.transitionID) { @@ -953,7 +953,7 @@ - (void)_completeLayoutTransition:(ASLayoutTransition *)layoutTransition if (ASDisplayNodeThreadIsMain() || layoutTransition.isSynchronous == NO) { // Committing the layout transition will result in subnode insertions and removals, both of which must be called without the lock held // TODO: Disabled due to PR: https://github.com/TextureGroup/Texture/pull/1204 - // ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); [layoutTransition commitTransition]; } else { // Subnode insertions and removals need to happen always on the main thread if at least one subnode is already loaded @@ -1019,7 +1019,7 @@ - (void)_pendingLayoutTransitionDidComplete // Subclass hook // TODO: Disabled due to PR: https://github.com/TextureGroup/Texture/pull/1204 - // ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); [self calculatedLayoutDidChange]; // Grab lock after calling out to subclass @@ -1063,7 +1063,7 @@ - (void)_setCalculatedDisplayNodeLayout:(const ASDisplayNodeLayout &)displayNode - (void)_locked_setCalculatedDisplayNodeLayout:(const ASDisplayNodeLayout &)displayNodeLayout { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); ASDisplayNodeAssertTrue(displayNodeLayout.layout.layoutElement == self); ASDisplayNodeAssertTrue(displayNodeLayout.layout.size.width >= 0.0); ASDisplayNodeAssertTrue(displayNodeLayout.layout.size.height >= 0.0); diff --git a/Source/ASDisplayNode+LayoutSpec.mm b/Source/ASDisplayNode+LayoutSpec.mm index d79073ffd..8e5f76fc1 100644 --- a/Source/ASDisplayNode+LayoutSpec.mm +++ b/Source/ASDisplayNode+LayoutSpec.mm @@ -117,7 +117,7 @@ - (ASLayout *)calculateLayoutLayoutSpec:(ASSizeRange)constrainedSize - (id)_locked_layoutElementThatFits:(ASSizeRange)constrainedSize { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); BOOL measureLayoutSpec = _measurementOptions & ASDisplayNodePerformanceMeasurementOptionLayoutSpec; diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index d89ee11a5..7416fb773 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -499,13 +499,13 @@ - (void)dealloc - (BOOL)_locked_shouldLoadViewOrLayer { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); return !_flags.isDeallocating && !(_hierarchyState & ASHierarchyStateRasterized); } - (UIView *)_locked_viewToLoad { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); UIView *view = nil; if (_viewBlock) { @@ -545,7 +545,7 @@ - (UIView *)_locked_viewToLoad - (CALayer *)_locked_layerToLoad { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); ASDisplayNodeAssert(_flags.layerBacked, @"_layerToLoad is only for layer-backed nodes"); CALayer *layer = nil; @@ -564,7 +564,7 @@ - (CALayer *)_locked_layerToLoad - (void)_locked_loadViewOrLayer { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); if (_flags.layerBacked) { TIME_SCOPED(_debugTimeToCreateView); @@ -594,7 +594,7 @@ - (void)_locked_loadViewOrLayer - (void)_didLoad { ASDisplayNodeAssertMainThread(); - ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); ASDisplayNodeLogEvent(self, @"didLoad"); as_log_verbose(ASNodeLog(), "didLoad %@", self); TIME_SCOPED(_debugTimeForDidLoad); @@ -627,7 +627,7 @@ - (BOOL)isNodeLoaded - (BOOL)_locked_isNodeLoaded { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); return _loaded(self); } @@ -728,7 +728,7 @@ - (_ASDisplayLayer *)asyncLayer - (_ASDisplayLayer *)_locked_asyncLayer { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); return [_layer isKindOfClass:[_ASDisplayLayer class]] ? (_ASDisplayLayer *)_layer : nil; } @@ -787,7 +787,7 @@ - (CGRect)threadSafeBounds - (CGRect)_locked_threadSafeBounds { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); return _threadSafeBounds; } @@ -1051,7 +1051,7 @@ - (void)invalidateCalculatedLayout - (void)__layout { ASDisplayNodeAssertThreadAffinity(self); - // ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); BOOL loaded = NO; { @@ -1101,7 +1101,7 @@ - (void)__layout - (void)_layoutDidFinish { ASDisplayNodeAssertMainThread(); - // ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); ASDisplayNodeAssertTrue(self.isNodeLoaded); [self layoutDidFinish]; } @@ -1174,7 +1174,7 @@ - (void)layout { // Hook for subclasses ASDisplayNodeAssertMainThread(); - // ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); ASDisplayNodeAssertTrue(self.isNodeLoaded); [self enumerateInterfaceStateDelegates:^(id del) { [del nodeDidLayout]; @@ -1221,7 +1221,7 @@ - (BOOL)displaysAsynchronously */ - (BOOL)_locked_displaysAsynchronously { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); return checkFlag(Synchronous) == NO && _flags.displaysAsynchronously; } @@ -2124,7 +2124,7 @@ - (void)_insertSubnode:(ASDisplayNode *)subnode atSubnodeIndex:(NSInteger)subnod { ASDisplayNodeAssertThreadAffinity(self); // TODO: Disabled due to PR: https://github.com/TextureGroup/Texture/pull/1204 - // ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); as_log_verbose(ASNodeLog(), "Insert subnode %@ at index %zd of %@ and remove subnode %@", subnode, subnodeIndex, self, oldSubnode); @@ -2334,7 +2334,7 @@ - (void)_insertSubnode:(ASDisplayNode *)subnode belowSubnode:(ASDisplayNode *)be { ASDisplayNodeAssertThreadAffinity(self); // TODO: Disabled due to PR: https://github.com/TextureGroup/Texture/pull/1204 - // ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); if (subnode == nil) { ASDisplayNodeFailAssert(@"Cannot insert a nil subnode"); @@ -2399,7 +2399,7 @@ - (void)_insertSubnode:(ASDisplayNode *)subnode aboveSubnode:(ASDisplayNode *)ab { ASDisplayNodeAssertThreadAffinity(self); // TODO: Disabled due to PR: https://github.com/TextureGroup/Texture/pull/1204 - // ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); if (subnode == nil) { ASDisplayNodeFailAssert(@"Cannot insert a nil subnode"); @@ -2462,7 +2462,7 @@ - (void)_insertSubnode:(ASDisplayNode *)subnode atIndex:(NSInteger)idx { ASDisplayNodeAssertThreadAffinity(self); // TODO: Disabled due to PR: https://github.com/TextureGroup/Texture/pull/1204 - // ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); if (subnode == nil) { ASDisplayNodeFailAssert(@"Cannot insert a nil subnode"); @@ -2500,7 +2500,7 @@ - (void)_removeSubnode:(ASDisplayNode *)subnode { ASDisplayNodeAssertThreadAffinity(self); // TODO: Disabled due to PR: https://github.com/TextureGroup/Texture/pull/1204 - // ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); // Don't call self.supernode here because that will retain/autorelease the supernode. This method -_removeSupernode: is often called while tearing down a node hierarchy, and the supernode in question might be in the middle of its -dealloc. The supernode is never messaged, only compared by value, so this is safe. // The particular issue that triggers this edge case is when a node calls -removeFromSupernode on a subnode from within its own -dealloc method. @@ -2527,7 +2527,7 @@ - (void)_removeFromSupernode { ASDisplayNodeAssertThreadAffinity(self); // TODO: Disabled due to PR: https://github.com/TextureGroup/Texture/pull/1204 - // ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); __instanceLock__.lock(); __weak ASDisplayNode *supernode = _supernode; @@ -2542,7 +2542,7 @@ - (void)_removeFromSupernodeIfEqualTo:(ASDisplayNode *)supernode { ASDisplayNodeAssertThreadAffinity(self); // TODO: Disabled due to PR: https://github.com/TextureGroup/Texture/pull/1204 - // ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); __instanceLock__.lock(); @@ -2635,7 +2635,7 @@ - (void)__decrementVisibilityNotificationsDisabled - (void)_locked_layoutPlaceholderIfNecessary { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); if ([self _locked_shouldHavePlaceholderLayer]) { [self _locked_setupPlaceholderLayerIfNeeded]; } @@ -2645,14 +2645,14 @@ - (void)_locked_layoutPlaceholderIfNecessary - (BOOL)_locked_shouldHavePlaceholderLayer { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); return (_placeholderEnabled && [self _implementsDisplay]); } - (void)_locked_setupPlaceholderLayerIfNeeded { ASDisplayNodeAssertMainThread(); - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); if (!_placeholderLayer) { _placeholderLayer = [CALayer layer]; @@ -2852,7 +2852,7 @@ - (void)willEnterHierarchy ASDisplayNodeAssertMainThread(); ASDisplayNodeAssert(_flags.isEnteringHierarchy, @"You should never call -willEnterHierarchy directly. Appearance is automatically managed by ASDisplayNode"); ASDisplayNodeAssert(!_flags.isExitingHierarchy, @"ASDisplayNode inconsistency. __enterHierarchy and __exitHierarchy are mutually exclusive"); - ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); if (![self supportsRangeManagedInterfaceState]) { self.interfaceState = ASInterfaceStateInHierarchy; @@ -2873,7 +2873,7 @@ - (void)didEnterHierarchy { ASDisplayNodeAssert(!_flags.isEnteringHierarchy, @"You should never call -didEnterHierarchy directly. Appearance is automatically managed by ASDisplayNode"); ASDisplayNodeAssert(!_flags.isExitingHierarchy, @"ASDisplayNode inconsistency. __enterHierarchy and __exitHierarchy are mutually exclusive"); ASDisplayNodeAssert(_flags.isInHierarchy, @"ASDisplayNode inconsistency. __enterHierarchy and __exitHierarchy are mutually exclusive"); - ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); [self enumerateInterfaceStateDelegates:^(id del) { if ([del respondsToSelector:@selector(didEnterHierarchy)]) { @@ -2887,7 +2887,7 @@ - (void)didExitHierarchy ASDisplayNodeAssertMainThread(); ASDisplayNodeAssert(_flags.isExitingHierarchy, @"You should never call -didExitHierarchy directly. Appearance is automatically managed by ASDisplayNode"); ASDisplayNodeAssert(!_flags.isEnteringHierarchy, @"ASDisplayNode inconsistency. __enterHierarchy and __exitHierarchy are mutually exclusive"); - ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); [self enumerateInterfaceStateDelegates:^(id del) { if ([del respondsToSelector:@selector(didExitHierarchy)]) { @@ -3017,7 +3017,7 @@ - (void)applyPendingInterfaceState:(ASInterfaceState)newPendingState ASDisplayNodeAssertMainThread(); // This method manages __instanceLock__ itself, to ensure the lock is not held while didEnter/Exit(.*)State methods are called, thus avoid potential deadlocks - ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); ASInterfaceState oldState = ASInterfaceStateNone; ASInterfaceState newState = ASInterfaceStateNone; @@ -3148,7 +3148,7 @@ - (void)prepareForCATransactionCommit - (void)_interfaceStateDidChange:(ASInterfaceState)newState fromState:(ASInterfaceState)oldState { - ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); ASDisplayNodeAssertMainThread(); [self interfaceStateDidChange:newState fromState:oldState]; [self enumerateInterfaceStateDelegates:^(id del) { @@ -3204,7 +3204,7 @@ - (void)_didEnterVisibleState } #endif - ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); [self didEnterVisibleState]; [self enumerateInterfaceStateDelegates:^(id del) { [del didEnterVisibleState]; @@ -3218,7 +3218,7 @@ - (void)_didEnterVisibleState - (void)_didExitVisibleState { ASDisplayNodeAssertMainThread(); - ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); [self didExitVisibleState]; [self enumerateInterfaceStateDelegates:^(id del) { [del didExitVisibleState]; @@ -3234,7 +3234,7 @@ - (BOOL)isInDisplayState - (void)_didEnterDisplayState { ASDisplayNodeAssertMainThread(); - ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); [self didEnterDisplayState]; [self enumerateInterfaceStateDelegates:^(id del) { [del didEnterDisplayState]; @@ -3244,7 +3244,7 @@ - (void)_didEnterDisplayState - (void)_didExitDisplayState { ASDisplayNodeAssertMainThread(); - ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); [self didExitDisplayState]; [self enumerateInterfaceStateDelegates:^(id del) { [del didExitDisplayState]; @@ -3285,7 +3285,7 @@ - (void)recursivelyClearPreloadedData - (void)_didEnterPreloadState { ASDisplayNodeAssertMainThread(); - ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); [self didEnterPreloadState]; // If this node has ASM enabled and is not yet visible, force a layout pass to apply its applicable pending layout, if any, @@ -3308,7 +3308,7 @@ - (void)_didEnterPreloadState - (void)_didExitPreloadState { ASDisplayNodeAssertMainThread(); - ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); [self didExitPreloadState]; [self enumerateInterfaceStateDelegates:^(id del) { [del didExitPreloadState]; @@ -3318,7 +3318,7 @@ - (void)_didExitPreloadState - (void)clearContents { ASDisplayNodeAssertMainThread(); - ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); MutexLocker l(__instanceLock__); if (_flags.canClearContentsOfLayer) { @@ -3341,7 +3341,7 @@ - (void)recursivelyClearContents - (void)enumerateInterfaceStateDelegates:(void (NS_NOESCAPE ^)(id))block { - ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); id dels[AS_MAX_INTERFACE_STATE_DELEGATES]; int count = 0; @@ -3437,7 +3437,7 @@ - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event - (void)_locked_applyPendingStateToViewOrLayer { ASDisplayNodeAssertMainThread(); - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); ASDisplayNodeAssert(self.nodeLoaded, @"must have a view or layer"); TIME_SCOPED(_debugTimeToApplyPendingState); @@ -3457,7 +3457,7 @@ - (void)_locked_applyPendingStateToViewOrLayer - (void)applyPendingViewState { ASDisplayNodeAssertMainThread(); - ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); AS::UniqueLock l(__instanceLock__); // FIXME: Ideally we'd call this as soon as the node receives -setNeedsLayout @@ -3476,7 +3476,7 @@ - (void)applyPendingViewState - (void)_locked_applyPendingViewState { ASDisplayNodeAssertMainThread(); - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); ASDisplayNodeAssert([self _locked_isNodeLoaded], @"Expected node to be loaded before applying pending state."); if (_flags.layerBacked) { diff --git a/Source/ASImageNode+AnimatedImage.mm b/Source/ASImageNode+AnimatedImage.mm index c07630cba..e83cbdcad 100644 --- a/Source/ASImageNode+AnimatedImage.mm +++ b/Source/ASImageNode+AnimatedImage.mm @@ -42,7 +42,7 @@ - (void)setAnimatedImage:(id )animatedImage - (void)_locked_setAnimatedImage:(id )animatedImage { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); if (ASObjectIsEqual(_animatedImage, animatedImage) && (animatedImage == nil || animatedImage.playbackReady)) { return; @@ -95,7 +95,7 @@ - (void)_locked_setAnimatedImage:(id )animatedImage - (void)animatedImageSet:(id )newAnimatedImage previousAnimatedImage:(id )previousAnimatedImage { // Subclass hook should not be called with the lock held - ASAssertUnlocked(__instanceLock__); + DISABLED_ASAssertUnlocked(__instanceLock__); // Subclasses may override } @@ -131,7 +131,7 @@ - (void)setCoverImageCompleted:(UIImage *)coverImage - (void)_locked_setCoverImageCompleted:(UIImage *)coverImage { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); _displayLinkLock.lock(); BOOL setCoverImage = (_displayLink == nil) || _displayLink.paused; @@ -150,7 +150,7 @@ - (void)setCoverImage:(UIImage *)coverImage - (void)_locked_setCoverImage:(UIImage *)coverImage { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); //If we're a network image node, we want to set the default image so //that it will correctly be restored if it exits the range. @@ -193,7 +193,7 @@ - (void)setShouldAnimate:(BOOL)shouldAnimate - (void)_locked_setShouldAnimate:(BOOL)shouldAnimate { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); // This test is explicitly done and not ASPerformBlockOnMainThread as this would perform the block immediately // on main if called on main thread and we have to call methods locked or unlocked based on which thread we are on @@ -228,7 +228,7 @@ - (void)startAnimating - (void)_locked_startAnimating { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); // It should be safe to call self.interfaceState in this case as it will only grab the lock of the superclass if (!ASInterfaceStateIncludesVisible(self.interfaceState)) { @@ -273,7 +273,7 @@ - (void)stopAnimating - (void)_locked_stopAnimating { ASDisplayNodeAssertMainThread(); - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); #if ASAnimatedImageDebug NSLog(@"stopping animation: %p", self); diff --git a/Source/ASImageNode.mm b/Source/ASImageNode.mm index 0513d511f..ce46ee64b 100644 --- a/Source/ASImageNode.mm +++ b/Source/ASImageNode.mm @@ -235,7 +235,7 @@ - (void)setImage:(UIImage *)image - (void)_locked_setImage:(UIImage *)image { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); if (ASObjectIsEqual(_image, image)) { return; } diff --git a/Source/ASMultiplexImageNode.mm b/Source/ASMultiplexImageNode.mm index ff5e9357e..e7b69a7e7 100644 --- a/Source/ASMultiplexImageNode.mm +++ b/Source/ASMultiplexImageNode.mm @@ -486,7 +486,7 @@ - (UIImage *)_bestImmediatelyAvailableImageFromDataSource:(id *)imageIdentifierO - (void)_updatePriorityOnDownloaderIfNeededWithDefaultPriority:(ASImageDownloaderPriority)defaultPriority { - ASAssertUnlocked(_downloadIdentifierLock); + DISABLED_ASAssertUnlocked(_downloadIdentifierLock); if (_downloaderFlags.downloaderImplementsSetPriority) { // Read our interface state before locking so that we don't lock super while holding our lock. @@ -506,7 +506,7 @@ - (void)_updatePriorityOnDownloaderIfNeededWithDefaultPriority:(ASImageDownloade - (void)_updateProgressImageBlockOnDownloaderIfNeeded { - ASAssertUnlocked(_downloadIdentifierLock); + DISABLED_ASAssertUnlocked(_downloadIdentifierLock); BOOL shouldRenderProgressImages = self.shouldRenderProgressImages; diff --git a/Source/ASNetworkImageNode.mm b/Source/ASNetworkImageNode.mm index 5bd87f62c..0deb8bb70 100644 --- a/Source/ASNetworkImageNode.mm +++ b/Source/ASNetworkImageNode.mm @@ -141,7 +141,7 @@ - (void)setImage:(UIImage *)image - (void)_locked_setImage:(UIImage *)image { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); BOOL imageWasSetExternally = (image != nil); BOOL shouldCancelAndClear = imageWasSetExternally && (imageWasSetExternally != _imageWasSetExternally); @@ -169,7 +169,7 @@ - (void)_setImage:(UIImage *)image - (void)_locked__setImage:(UIImage *)image { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); [super _locked_setImage:image]; } @@ -528,7 +528,7 @@ - (void)_cancelDownloadAndClearImageWithResumePossibility:(BOOL)storeResume - (void)_locked_cancelDownloadAndClearImageWithResumePossibility:(BOOL)storeResume { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); [self _locked_cancelImageDownloadWithResumePossibility:storeResume]; @@ -554,7 +554,7 @@ - (void)_cancelImageDownloadWithResumePossibility:(BOOL)storeResume - (void)_locked_cancelImageDownloadWithResumePossibility:(BOOL)storeResume { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); if (!_downloadIdentifier) { return; diff --git a/Source/ASTextNode.mm b/Source/ASTextNode.mm index 0771f9265..b1465fcde 100644 --- a/Source/ASTextNode.mm +++ b/Source/ASTextNode.mm @@ -350,20 +350,20 @@ - (ASTextKitRenderer *)_rendererWithBounds:(CGRect)bounds - (ASTextKitRenderer *)_locked_renderer { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); return [self _locked_rendererWithBounds:[self _locked_threadSafeBounds]]; } - (ASTextKitRenderer *)_locked_rendererWithBounds:(CGRect)bounds { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); bounds = UIEdgeInsetsInsetRect(bounds, _textContainerInset); return rendererForAttributes([self _locked_rendererAttributes], bounds.size); } - (ASTextKitAttributes)_locked_rendererAttributes { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); return { .attributedString = _attributedText, .truncationAttributedString = [self _locked_composedTruncationText], @@ -1359,7 +1359,7 @@ - (NSRange)_additionalTruncationMessageRangeWithVisibleRange:(NSRange)visibleRan */ - (NSAttributedString *)_locked_composedTruncationText { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); if (_composedTruncationText == nil) { if (_truncationAttributedText != nil && _additionalTruncationMessage != nil) { NSMutableAttributedString *newComposedTruncationString = [[NSMutableAttributedString alloc] initWithAttributedString:_truncationAttributedText]; @@ -1385,7 +1385,7 @@ - (NSAttributedString *)_locked_composedTruncationText */ - (NSAttributedString *)_locked_prepareTruncationStringForDrawing:(NSAttributedString *)truncationString { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); truncationString = ASCleanseAttributedStringOfCoreTextAttributes(truncationString); NSMutableAttributedString *truncationMutableString = [truncationString mutableCopy]; // Grab the attributes from the full string diff --git a/Source/ASTextNode2.mm b/Source/ASTextNode2.mm index ceca414a0..f8d5e97ae 100644 --- a/Source/ASTextNode2.mm +++ b/Source/ASTextNode2.mm @@ -1249,7 +1249,7 @@ - (NSRange)_additionalTruncationMessageRangeWithVisibleRange:(NSRange)visibleRan */ - (NSAttributedString *)_locked_composedTruncationText { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); if (_composedTruncationText == nil) { if (_truncationAttributedText != nil && _additionalTruncationMessage != nil) { NSMutableAttributedString *newComposedTruncationString = [[NSMutableAttributedString alloc] initWithAttributedString:_truncationAttributedText]; @@ -1275,7 +1275,7 @@ - (NSAttributedString *)_locked_composedTruncationText */ - (NSAttributedString *)_locked_prepareTruncationStringForDrawing:(NSAttributedString *)truncationString { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); NSMutableAttributedString *truncationMutableString = [truncationString mutableCopy]; // Grab the attributes from the full string if (_attributedText.length > 0) { diff --git a/Source/ASVideoPlayerNode.mm b/Source/ASVideoPlayerNode.mm index 08d86770d..f8fdc06cf 100644 --- a/Source/ASVideoPlayerNode.mm +++ b/Source/ASVideoPlayerNode.mm @@ -339,7 +339,7 @@ - (void)_locked_cleanCachedControls - (void)_locked_createPlaybackButton { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); if (_playbackButtonNode == nil) { _playbackButtonNode = [[ASDefaultPlaybackButton alloc] init]; @@ -367,7 +367,7 @@ - (void)_locked_createPlaybackButton - (void)_locked_createFullScreenButton { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); if (_fullScreenButtonNode == nil) { _fullScreenButtonNode = [[ASButtonNode alloc] init]; @@ -389,7 +389,7 @@ - (void)_locked_createFullScreenButton - (void)_locked_createElapsedTextField { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); if (_elapsedTextNode == nil) { _elapsedTextNode = [[ASTextNode alloc] init]; @@ -407,7 +407,7 @@ - (void)_locked_createElapsedTextField - (void)_locked_createDurationTextField { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); if (_durationTextNode == nil) { _durationTextNode = [[ASTextNode alloc] init]; @@ -426,7 +426,7 @@ - (void)_locked_createDurationTextField - (void)_locked_createScrubber { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); if (_scrubberNode == nil) { __weak __typeof__(self) weakSelf = self; @@ -474,7 +474,7 @@ - (void)_locked_createScrubber - (void)_locked_createControlFlexGrowSpacer { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); if (_controlFlexGrowSpacerSpec == nil) { _controlFlexGrowSpacerSpec = [[ASStackLayoutSpec alloc] init]; diff --git a/Source/Details/ASThread.h b/Source/Details/ASThread.h index 78421fe6e..4bc4a29b6 100644 --- a/Source/Details/ASThread.h +++ b/Source/Details/ASThread.h @@ -100,8 +100,8 @@ ASDISPLAYNODE_INLINE void _ASUnlockScopeCleanup(id __strong *lockPtr) #include // These macros are here for legacy reasons. We may get rid of them later. -#define ASAssertLocked(m) m.AssertHeld() -#define ASAssertUnlocked(m) m.AssertNotHeld() +#define DISABLED_ASAssertLocked(m) +#define DISABLED_ASAssertUnlocked(m) namespace AS { diff --git a/Source/Private/ASDisplayNode+UIViewBridge.mm b/Source/Private/ASDisplayNode+UIViewBridge.mm index 6f12d0d14..2e81d4021 100644 --- a/Source/Private/ASDisplayNode+UIViewBridge.mm +++ b/Source/Private/ASDisplayNode+UIViewBridge.mm @@ -1021,7 +1021,7 @@ - (void)setLayerMaskedCorners:(CACornerMask)newLayerMaskedCorners - (BOOL)_locked_insetsLayoutMarginsFromSafeArea { - ASAssertLocked(__instanceLock__); + DISABLED_ASAssertLocked(__instanceLock__); if (AS_AVAILABLE_IOS(11.0)) { if (!_flags.layerBacked) { return _getFromViewOnly(insetsLayoutMarginsFromSafeArea);