This repository was archived by the owner on Feb 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[ASDisplayNode] Improve Transition ID handling #1622
Merged
appleguy
merged 2 commits into
facebookarchive:master
from
maicki:ImproveTransitionIDHandling
May 7, 2016
Merged
[ASDisplayNode] Improve Transition ID handling #1622
appleguy
merged 2 commits into
facebookarchive:master
from
maicki:ImproveTransitionIDHandling
May 7, 2016
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Really great stuff, @maicki! I can imagine this wasn't easy to find. |
AsyncDisplayKit/ASDisplayNode.mm
Outdated
return _transitionSentinel == nil || transitionID != _transitionSentinel.value; | ||
} | ||
|
||
return YES; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this is a bit better?
- (BOOL)_shouldAbortTransitionWithID:(int32_t)transitionID
{
ASDN::MutexLocker l(_propertyLock);
return !_transitionInProgress || _transitionSentinel == nil || transitionID != _transitionSentinel.value;
}
@appleguy @nguyenhuy Addressed comments from @nguyenhuy
|
if ([self _hasTransitionsInProgress]) { | ||
// Invalidate transition sentinel to cancel transitions in progress | ||
[self _invalidateTransitionSentinel]; | ||
if ([self _hasTransitionInProgress]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both of these names are more clear than they were before. Thanks!
@maicki amazing investigatory work here! It's a testament to your understanding of the code that the lines changed is relatively small. |
aimalygin
pushed a commit
to aimalygin/AsyncDisplayKit
that referenced
this pull request
Sep 23, 2019
* Simplify code logic * Keep using user-defined type
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently in a race condition situation it can happen that subnodes get transition ids from supernodes where the supernodes transition id was reset but the subnode still has the old transition id value. This will trigger an exception although the assignment of the transition id is totally valid. This PR should address this by not reseting the transition id at all for a node and increase the transition id for new transitions.
cc @nguyenhuy @appleguy @levi