move call to Classpath::shutDown

We must be in the Active state, not the Exclusive state when calling
this method since it may execute arbitrary Java code.  This fixes an
assertion failure in makeNew.
This commit is contained in:
Joel Dice 2013-04-22 21:29:58 -06:00
parent 8995db69d2
commit dfdd1f6e6c
2 changed files with 5 additions and 2 deletions

View File

@ -74,6 +74,11 @@ DetachCurrentThread(Machine* m)
uint64_t
destroyJavaVM(Thread* t, uintptr_t*)
{
{ ENTER(t, Thread::ActiveState);
t->m->classpath->shutDown(t);
}
// wait for other non-daemon threads to exit
{ ACQUIRE(t, t->m->stateLock);
while (t->m->liveCount - t->m->daemonCount > 1) {

View File

@ -3324,8 +3324,6 @@ shutDown(Thread* t)
setRoot(t, Machine::ShutdownHooks, 0);
t->m->classpath->shutDown(t);
object h = hooks;
PROTECT(t, h);
for (; h; h = pairSecond(t, h)) {