Skip to content

ensure animatedNodes collection is only accessed on render thread#53734

Closed
zeyap wants to merge 1 commit into
facebook:mainfrom
zeyap:export-D82119554
Closed

ensure animatedNodes collection is only accessed on render thread#53734
zeyap wants to merge 1 commit into
facebook:mainfrom
zeyap:export-D82119554

Conversation

@zeyap
Copy link
Copy Markdown
Contributor

@zeyap zeyap commented Sep 11, 2025

Summary:

Changelog:

[Internal] [Changed] - ensure animatedNodes collection is only accessed on render thread

now createAnimatedNode can be called async from js thread (since #53476), animatedNodes_ will be written on both threads, there was no proper locking mechanism for read

we can simply add locks wherever we read/write animatedNodes_; but there's way to use fewer locking - since AnimatedNode is created async, but will not be R/W async anywhere else, we can add a new collection to temporarily hold nodes created async and flush it on render thread

Differential Revision: D82119554

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 11, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D82119554

…cebook#53734)

Summary:

## Changelog:

[Internal] [Changed] - ensure animatedNodes collection is only accessed on render thread

now `createAnimatedNode` can be called async from js thread (since facebook#53476), `animatedNodes_` will be written on both threads, there was no proper locking mechanism for read

we can simply add locks wherever we read/write animatedNodes_; but there's way to use fewer locking - since AnimatedNode is created async, but will not be R/W async anywhere else, we can add a new collection to temporarily hold nodes created async and flush it on render thread

Reviewed By: lenaic

Differential Revision: D82119554
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@zeyap has exported this pull request. If you are a Meta employee, you can view the originating diff in D82119554.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 54ebfaf.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @zeyap in 54ebfaf

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants