Skip to content
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

Prevent race conditions in TimerManager #48519

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

christophpurrer
Copy link
Contributor

Summary:
When working on RN instance reload in D67818969 I noticed that we can crash in TimerManager when the RN instance is reloaded.

{F1974211648}

This change aims to fix it.

NOTE: TimerManager is a shared_ptr

React Native Granite

https://www.internalfb.com/code/fbsource/[46cacd0162d251cfcd08f069f20eaec600f59c7f]/xplat/ReactNative/react-native-cxx/react/runtime/ReactHost.cpp?lines=119-120

React Native iOS / Android

https://www.internalfb.com/code/search?q=-filepath%3ATimerManager.h%7CTimerManager.cpp%20filepath%3Areact-native-github%20case%3Ayes%20repo%3Afbsource%20TimerManager&lang_filter=cpp%2Cobjective-cpp

Differential Revision: D67888312

@facebook-github-bot facebook-github-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 Jan 7, 2025
@facebook-github-bot
Copy link
Contributor

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

christophpurrer added a commit to christophpurrer/react-native-macos that referenced this pull request Jan 7, 2025
Summary:

When working on RN instance reload in D67818969 I noticed that we can crash in TimerManager when the RN instance is reloaded.

{F1974211648}

This change aims to fix it.

NOTE: `TimerManager` is a shared_ptr

React Native Granite

https://www.internalfb.com/code/fbsource/[46cacd0162d251cfcd08f069f20eaec600f59c7f]/xplat/ReactNative/react-native-cxx/react/runtime/ReactHost.cpp?lines=119-120

React Native iOS / Android

https://www.internalfb.com/code/search?q=-filepath%3ATimerManager.h%7CTimerManager.cpp%20filepath%3Areact-native-github%20case%3Ayes%20repo%3Afbsource%20TimerManager&lang_filter=cpp%2Cobjective-cpp

Differential Revision: D67888312
@facebook-github-bot
Copy link
Contributor

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

christophpurrer added a commit to christophpurrer/react-native-macos that referenced this pull request Jan 7, 2025
Summary:

When working on RN instance reload in D67818969 I noticed that we can crash in TimerManager when the RN instance is reloaded.

{F1974211648}

This change aims to fix it.

NOTE: `TimerManager` is a shared_ptr

React Native Granite

https://www.internalfb.com/code/fbsource/[46cacd0162d251cfcd08f069f20eaec600f59c7f]/xplat/ReactNative/react-native-cxx/react/runtime/ReactHost.cpp?lines=119-120

React Native iOS / Android

https://www.internalfb.com/code/search?q=-filepath%3ATimerManager.h%7CTimerManager.cpp%20filepath%3Areact-native-github%20case%3Ayes%20repo%3Afbsource%20TimerManager&lang_filter=cpp%2Cobjective-cpp

Differential Revision: D67888312
@facebook-github-bot
Copy link
Contributor

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

Summary:

When working on RN instance reload in D67818969 I noticed that we can crash in TimerManager when the RN instance is reloaded.

{F1974211648}

This change aims to fix it.

NOTE: `TimerManager` is a shared_ptr

React Native Granite

https://www.internalfb.com/code/fbsource/[46cacd0162d251cfcd08f069f20eaec600f59c7f]/xplat/ReactNative/react-native-cxx/react/runtime/ReactHost.cpp?lines=119-120

React Native iOS / Android

https://www.internalfb.com/code/search?q=-filepath%3ATimerManager.h%7CTimerManager.cpp%20filepath%3Areact-native-github%20case%3Ayes%20repo%3Afbsource%20TimerManager&lang_filter=cpp%2Cobjective-cpp

Differential Revision: D67888312
@facebook-github-bot
Copy link
Contributor

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

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 p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants