Fix asm2wasm dead lock caused by empty module#682
Merged
kripken merged 3 commits intoWebAssembly:masterfrom Aug 26, 2016
Merged
Fix asm2wasm dead lock caused by empty module#682kripken merged 3 commits intoWebAssembly:masterfrom
kripken merged 3 commits intoWebAssembly:masterfrom
Conversation
This commit modernize the code base by replacing:
std::unique_ptr<T>(new T(...))
with:
make_unique<T>(...)
or:
wasm::make_unique<T>(...)
This is a step closer to adopt C++14 std::make_unique<T>(...).
std::thread can forward the arguments to main function properly. We don't have to cast them from/to void*.
This commit fixes an asm2wasm dead lock when asm2wasm is compiling an empty module, i.e. a module without any functions. Without this commit, worker threads are likely to leave `workerMain()` and decrease `liveWorkers` early. Consequently, `waitUntilAllReady()` will never observe `liveWorkers == numWorkers`.
Member
|
Thanks, this is great! :) Can you please join the working group if you haven't already, before we merge? |
Contributor
Author
|
Sure. Now you can find me (Logan Chien) in participants list. |
Member
|
Excellent, thanks again! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These commits fix an asm2wasm dead lock when asm2wasm is compiling an empty module, i.e. a module without any functions.
Without this commit, worker threads are likely to leave
workerMain()and decreaseliveWorkersearly. Consequently,waitUntilAllReady()will never observeliveWorkers == numWorkers.