mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
wait for other threads to exit in DestroyJavaVM
This commit is contained in:
parent
86dfaf9ff0
commit
e46e222f38
@ -34,6 +34,14 @@ DestroyJavaVM(Machine* m)
|
||||
Finder* f = m->finder;
|
||||
Thread* t = m->rootThread;
|
||||
|
||||
// wait for other threads to exit
|
||||
{ ACQUIRE(t, m->stateLock);
|
||||
|
||||
while (m->liveCount > 1) {
|
||||
t->m->stateLock->wait(t->systemThread, 0);
|
||||
}
|
||||
}
|
||||
|
||||
int exitCode = (t->exception ? -1 : 0);
|
||||
enter(t, Thread::ActiveState);
|
||||
t->exit();
|
||||
|
Loading…
Reference in New Issue
Block a user