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

Conversation

@kazuho
Copy link
Member

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

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

kazuho added a commit that referenced this pull request Jul 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.