Commit 834319ec authored by Kenton Varda's avatar Kenton Varda

Add missing code to ~Thread on Windows.

parent 5af76cac
......@@ -41,9 +41,13 @@ Thread::Thread(Function<void()> func): state(new ThreadState { kj::mv(func), nul
Thread::~Thread() noexcept(false) {
if (!detached) {
KJ_DEFER(state->unref());
KJ_ASSERT(WaitForSingleObject(threadHandle, INFINITE) != WAIT_FAILED);
KJ_IF_MAYBE(e, state->exception) {
Exception ecopy = kj::mv(*e);
state->exception = nullptr; // don't complain of uncaught exception when deleting
kj::throwRecoverableException(kj::mv(*e));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment