Skip to content

Conversation

andycall
Copy link

We are using QuickJS's JSRuntime in separate threads. We encountered an issue where JS_NewClass could fail if JS_NewRuntime and JS_FreeRuntime are called hundreds of times across many forked threads.

In this patch, we make js_class_id_alloc thread-local to ensure that each forked thread's class ID starts at JS_CLASS_INIT_COUNT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant