mirror of
https://github.com/corda/corda.git
synced 2025-01-03 19:54:13 +00:00
prevent garbage collection as vm shuts down
This commit is contained in:
parent
dbbd4e7d40
commit
fc84f62a65
@ -2885,7 +2885,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);
|
||||
@ -3452,7 +3453,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;
|
||||
|
@ -1972,6 +1972,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;
|
||||
|
Loading…
Reference in New Issue
Block a user