Skip to content

Commit

Permalink
Disable ASAssertLocked and ASAssertUnlocked (#1412)
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhuy committed Apr 20, 2019
1 parent 5c185ba commit 3120c4e
Show file tree
Hide file tree
Showing 12 changed files with 79 additions and 79 deletions.
20 changes: 10 additions & 10 deletions Source/ASDisplayNode+Layout.mm
Expand Up @@ -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
Expand Down Expand Up @@ -210,7 +210,7 @@ - (ASSizeRange)constrainedSizeForCalculatedLayout

- (ASSizeRange)_locked_constrainedSizeForCalculatedLayout
{
ASAssertLocked(__instanceLock__);
DISABLED_ASAssertLocked(__instanceLock__);
if (_pendingDisplayNodeLayout.isValid(_layoutVersion)) {
return _pendingDisplayNodeLayout.constrainedSize;
}
Expand Down Expand Up @@ -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");

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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);

Expand All @@ -513,7 +513,7 @@ - (ASSizeRange)_locked_constrainedSizeForLayoutPass
- (void)_layoutSublayouts
{
ASDisplayNodeAssertThreadAffinity(self);
// ASAssertUnlocked(__instanceLock__);
DISABLED_ASAssertUnlocked(__instanceLock__);

ASLayout *layout;
{
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Source/ASDisplayNode+LayoutSpec.mm
Expand Up @@ -117,7 +117,7 @@ - (ASLayout *)calculateLayoutLayoutSpec:(ASSizeRange)constrainedSize

- (id<ASLayoutElement>)_locked_layoutElementThatFits:(ASSizeRange)constrainedSize
{
ASAssertLocked(__instanceLock__);
DISABLED_ASAssertLocked(__instanceLock__);

BOOL measureLayoutSpec = _measurementOptions & ASDisplayNodePerformanceMeasurementOptionLayoutSpec;

Expand Down

0 comments on commit 3120c4e

Please sign in to comment.