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

implement our own "once" function #2086

Merged
merged 4 commits into from
Jul 22, 2019
Merged

implement our own "once" function #2086

merged 4 commits into from
Jul 22, 2019

Conversation

kazuho
Copy link
Member

@kazuho kazuho commented Jul 22, 2019

My affection to using closures instead of declaring callbacks (and global variables) is strong enough to define a replacement for pthread_once function that takes a closure as an argument.

Actually, this PR fixes theoretical race conditions in some of the initialization code that we run. 9c06f68 addresses two cases where an "index" might be used by a different thread, before the objects that are being referred to by that "index" is being written to memory.

@kazuho kazuho merged commit 9aa6380 into master Jul 22, 2019
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