mirror of
https://github.com/corda/corda.git
synced 2025-01-06 21:18:46 +00:00
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:
parent
45e4a6b022
commit
9f8369c5cc
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user