Skip to content

Conversation

@loganchien
Copy link
Contributor

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 decrease liveWorkers early. Consequently, waitUntilAllReady() will never observe liveWorkers == numWorkers.

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`.
@kripken
Copy link
Member

kripken commented Aug 25, 2016

Thanks, this is great! :)

Can you please join the working group if you haven't already, before we merge?

@loganchien
Copy link
Contributor Author

Sure. Now you can find me (Logan Chien) in participants list.

@kripken kripken merged commit 801baed into WebAssembly:master Aug 26, 2016
@kripken
Copy link
Member

kripken commented Aug 26, 2016

Excellent, thanks again!

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