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

Document HostFunction dtor threading requirement #44278

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/react-native/ReactCommon/jsi/jsi/jsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,11 @@ class JSI_EXPORT Function : public Object {
/// \param name the name property for the function.
/// \param paramCount the length property for the function, which
/// may not be the number of arguments the function is passed.
/// \note The std::function's dtor will be called when the GC finalizes this
/// function. As with HostObject, this may be as late as when the Runtime is
/// shut down, and may occur on an arbitrary thread. If the function contains
/// any captured values, you are responsible for ensuring that their
/// destructors are safe to call on any thread.
static Function createFromHostFunction(
Runtime& runtime,
const jsi::PropNameID& name,
Expand Down