-
Notifications
You must be signed in to change notification settings - Fork 24k
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
Calling JS callback asynchronously from C++ thread. #44813
Comments
|
Please create a repro using the Reproducer Template |
@cortinico I have updated the issue with the required ReproducerApp. |
In
|
@huzhanbo1996 Suppose only one thread in C++ is accessing the JS Runtime then how can we stop JavaScript from using Runtime when C++ is using it? |
In
It depends on what you want to achieve. In code you post. I presume you want to dispatch the task in another thread and return the result by callback in JS Thread. You could try things like serial queue or |
Description
I am encountering an issue where my React Native app crashes when a JavaScript callback is called from C++ code running on a C++ thread asynchronously. However, when I call the same callback on the same thread from where the foo function is called, it works as expected without crashing.
Steps to reproduce
Nil
React Native Version
0.74.1
Affected Platforms
Runtime - Android, Build - Windows
Areas
TurboModule - The New Native Module System, JSI - Javascript Interface, Bridgeless - The New Initialization Flow
Output of
npx react-native info
Stacktrace or Logs
Reproducer
JSI-App
Screenshots and Videos
App.tsx
C++ module
The text was updated successfully, but these errors were encountered: