-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Avoid setting frame on a node's backing store while holding its lock #1048
Avoid setting frame on a node's backing store while holding its lock #1048
Conversation
Doing so may trigger `-layer:didChangeBoundsWithOldValue:newValue:` on the layer's delegate (i.e `ASCALayerExtendedDelegate`) which then runs other operations that require the lock to be free.
🚫 CI failed with log |
Generated by 🚫 Danger |
|
||
if (setToView) { | ||
ASDisplayNodeAssertTrue(nodeLoaded && isMainThread); | ||
_view.frame = rect; |
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.
We may should grab the _view
and _layer
with the lock held?
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.
Those properties are only modified on main, and since this is on main thread, we can avoid locking.
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.
See also -isNodeLoaded
.
…extureGroup#1048) Doing so may trigger `-layer:didChangeBoundsWithOldValue:newValue:` on the layer's delegate (i.e `ASCALayerExtendedDelegate`) which then runs other operations that require the lock to be free.
…extureGroup#1048) Doing so may trigger `-layer:didChangeBoundsWithOldValue:newValue:` on the layer's delegate (i.e `ASCALayerExtendedDelegate`) which then runs other operations that require the lock to be free.
…'s lock (TextureGroup#1048)" This reverts commit 95de2ab.
Doing so may trigger
-layer:didChangeBoundsWithOldValue:newValue:
on the layer's delegate (i.eASCALayerExtendedDelegate
) which then runs other operations that require the lock to be free.