-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Fixing Race condition that happens with _wasBatchActive #13505
Conversation
Instead of making this a property (with all its other overhead, can you make that bool a C++ atomic_bool? |
I think that could work better, I can use that. Is it fine for overall plan about Batched Bridge? |
Yeah, that's fine. We use Objective-C++ in quite a few places. You'll just need to make sure to update all the targets in React.xcodeproj (and maybe make the same change for RCTCxxBridge and ReactCxx.xcodeproj)? |
ok |
Thanks! Can you update RCTCxxBridge too? https://github.com/facebook/react-native/blob/master/React/CxxBridge/RCTCxxBridge.mm#L106 |
It can be done as well, but I it seems _wasBatchActive is never set. |
Huh, that's a separate bug then. I'll follow up. Thanks again for fixing this! |
@javache has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
I tried to merge this pull request into the Facebook internal repo but some checks failed. To unblock yourself please check the following: Does this pull request pass all open source tests on GitHub? If not please fix those. Does the code still apply cleanly on top of GitHub master? If not can please rebase. In all other cases this means some internal test failed, for example a part of a fb app won't work with this pull request. I've added the Import Failed label to this pull request so it is easy for someone at fb to find the pull request and check what failed. If you don't see anyone comment in a few days feel free to comment mentioning one of the core contributors to the project so they get a notification. |
…g atomic property wasBatchActive with getter isBatchActive
done rebase with master |
@javache did I do something wrong that caused bot to close review? |
I see now, just different workflow that done by bot |
Summary: Issue Fix: facebook#13485 Yet another race condition that was found by XCode's Thread Sanitizer. Happens because wasBatchActive is read/write from multiple threads at the same time - opened UIExplorer and see it works - npm run test pass - tested on own project as well Signed CLA Closes facebook#13505 Differential Revision: D4906096 Pulled By: javache fbshipit-source-id: 5d4329aafcfe9491ce0188fa1e2dd71e09b31031
Summary: Issue Fix: facebook#13485 Yet another race condition that was found by XCode's Thread Sanitizer. Happens because wasBatchActive is read/write from multiple threads at the same time - opened UIExplorer and see it works - npm run test pass - tested on own project as well Signed CLA Closes facebook#13505 Differential Revision: D4906096 Pulled By: javache fbshipit-source-id: 5d4329aafcfe9491ce0188fa1e2dd71e09b31031
Issue Fix: #13485
Motivation (required)
Yet another race condition that was found by XCode's Thread Sanitizer.
Happens because wasBatchActive is read/write from multiple threads at the same time
Test Plan (required)
Next Steps
Signed CLA