handle null p->javaThread in addThread and removeThread

These functions may be called when p->javaThread is null, in which
case we must not try to set the threadPeer field.
This commit is contained in:
Joel Dice 2011-02-15 08:47:48 -07:00
parent 6461e0a1af
commit 86c48f3ff6

View File

@ -1973,7 +1973,9 @@ addThread(Thread* t, Thread* p)
p->peer = p->parent->child;
p->parent->child = p;
threadPeer(t, p->javaThread) = reinterpret_cast<jlong>(p);
if (p->javaThread) {
threadPeer(t, p->javaThread) = reinterpret_cast<jlong>(p);
}
}
inline void
@ -1989,7 +1991,9 @@ removeThread(Thread* t, Thread* p)
p->parent->child = p->peer;
threadPeer(t, p->javaThread) = 0;
if (p->javaThread) {
threadPeer(t, p->javaThread) = 0;
}
}
inline Thread*