mirror of
https://github.com/corda/corda.git
synced 2025-01-05 20:54:13 +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);
|
||||
|
||||
enter(t, Thread::ActiveState);
|
||||
|
||||
threadPeer(t, t->javaThread) = 0;
|
||||
|
||||
enter(t, Thread::ZombieState);
|
||||
|
||||
t->state = Thread::JoinedState;
|
||||
|
@ -2201,6 +2201,7 @@ Thread::exit()
|
||||
if (m->liveCount == 1) {
|
||||
turnOffTheLights(this);
|
||||
} else {
|
||||
threadPeer(this, javaThread) = 0;
|
||||
enter(this, Thread::ZombieState);
|
||||
}
|
||||
}
|
||||
@ -2209,8 +2210,6 @@ Thread::exit()
|
||||
void
|
||||
Thread::dispose()
|
||||
{
|
||||
threadPeer(this, javaThread) = 0;
|
||||
|
||||
if (systemThread) {
|
||||
systemThread->dispose();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user