mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
clear Thread::javaThread before entering zombie state, since clearing it in Thread::dispose is too late - the reference may already be invalid since we don't visit GC roots for zombie threads
This commit is contained in:
parent
c4b5ecec90
commit
6196f61938
@ -53,6 +53,9 @@ DetachCurrentThread(Machine* m)
|
|||||||
ACQUIRE_RAW(t, t->m->stateLock);
|
ACQUIRE_RAW(t, t->m->stateLock);
|
||||||
|
|
||||||
enter(t, Thread::ActiveState);
|
enter(t, Thread::ActiveState);
|
||||||
|
|
||||||
|
threadPeer(t, t->javaThread) = 0;
|
||||||
|
|
||||||
enter(t, Thread::ZombieState);
|
enter(t, Thread::ZombieState);
|
||||||
|
|
||||||
t->state = Thread::JoinedState;
|
t->state = Thread::JoinedState;
|
||||||
|
@ -2201,6 +2201,7 @@ Thread::exit()
|
|||||||
if (m->liveCount == 1) {
|
if (m->liveCount == 1) {
|
||||||
turnOffTheLights(this);
|
turnOffTheLights(this);
|
||||||
} else {
|
} else {
|
||||||
|
threadPeer(this, javaThread) = 0;
|
||||||
enter(this, Thread::ZombieState);
|
enter(this, Thread::ZombieState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2209,8 +2210,6 @@ Thread::exit()
|
|||||||
void
|
void
|
||||||
Thread::dispose()
|
Thread::dispose()
|
||||||
{
|
{
|
||||||
threadPeer(this, javaThread) = 0;
|
|
||||||
|
|
||||||
if (systemThread) {
|
if (systemThread) {
|
||||||
systemThread->dispose();
|
systemThread->dispose();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user