diff --git a/makefile b/makefile index 7e592d62ec..68a6fec003 100755 --- a/makefile +++ b/makefile @@ -1386,7 +1386,7 @@ endif $(build)/run-tests.sh: $(test-classes) makefile echo 'cd $$(dirname $$0)' > $(@) echo "sh ./test.sh 2>/dev/null \\" >> $(@) - echo "$(shell echo $(library-path) | sed 's|$(build)|\.|g') ./$(name)-unittest${exe-suffix} ./$(name)${exe-suffix} $(mode) \"-Djava.library.path=$$(pwd) -cp test\" \\" >> $(@) + echo "$(shell echo $(library-path) | sed 's|$(build)|\.|g') ./$(name)-unittest${exe-suffix} ./$(name)${exe-suffix} $(mode) \"-Djava.library.path=. -cp test\" \\" >> $(@) echo "$(call class-names,$(test-build),$(filter-out $(test-support-classes), $(test-classes))) \\" >> $(@) echo "$(continuation-tests) $(tail-tests)" >> $(@) diff --git a/src/machine.cpp b/src/machine.cpp index 62572412fe..528faac785 100644 --- a/src/machine.cpp +++ b/src/machine.cpp @@ -2910,7 +2910,8 @@ doCollect(Thread* t, Heap::CollectionType type) } if ((root(t, Machine::ObjectsToFinalize) or root(t, Machine::ObjectsToClean)) - and m->finalizeThread == 0) + and m->finalizeThread == 0 + and t->state != Thread::ExitState) { m->finalizeThread = m->processor->makeThread (m, root(t, Machine::FinalizerThread), m->rootThread); @@ -3473,7 +3474,7 @@ enter(Thread* t, Thread::State s) switch (t->state) { case Thread::ExclusiveState: { assert(t, t->m->exclusive == t); - t->m->exclusive = 0; + // exit state should also be exclusive, so don't set exclusive = 0 t->m->stateLock->notifyAll(t->systemThread); } break; diff --git a/src/machine.h b/src/machine.h index d4e6e787a2..70944a8a0c 100644 --- a/src/machine.h +++ b/src/machine.h @@ -1985,6 +1985,7 @@ addThread(Thread* t, Thread* p) ACQUIRE_RAW(t, t->m->stateLock); assert(t, p->state == Thread::NoState); + expect(t, t->state == Thread::ActiveState || t->state == Thread::ExclusiveState); p->state = Thread::IdleState; ++ t->m->threadCount;