Skip to content

Hide constructor functions and make thread-local #5

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

Merged
merged 4 commits into from
May 25, 2022
Merged

Conversation

sparist
Copy link
Collaborator

@sparist sparist commented Apr 7, 2022

This fixes usage in a multi-threaded context. Formerly, there was one static constructor function for each type, each containing its own Env instance. When Init() was called on another thread for a separate thread-local isolate, the static constructor function would be replaced. This came to my attention because it tripped an assertion due to the Env instance created on one thread being destroyed on another thread. Now, each thread has its own copy of the constructor function.

@sparist sparist requested a review from wesgarland April 7, 2022 18:09
@sparist sparist self-assigned this Apr 7, 2022
@sparist sparist changed the title Hide constructors and make thread-local Hide constructor functions and make thread-local Apr 7, 2022
@sparist sparist merged commit d68067e into dcp/release May 25, 2022
@sparist sparist deleted the dcp/develop branch May 25, 2022 21:26
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.

2 participants