enter exclusive state in destroyJavaVM

This is necessary to ensure that new threads do not start while we're
shutting down (except for the ones that we start to run the shutdown
hooks), and that the shutdown hook threads can be safely started (it
is not safe to start threads from e.g. an idle state, and an assertion
will fail if we do).
This commit is contained in:
Joel Dice 2013-04-15 12:37:23 -06:00
parent 45e4a6b022
commit 9f8369c5cc

View File

@ -79,6 +79,8 @@ destroyJavaVM(Thread* t, uintptr_t*)
while (t->m->liveCount - t->m->daemonCount > 1) {
t->m->stateLock->wait(t->systemThread, 0);
}
enter(t, Thread::ExclusiveState);
}
shutDown(t);