return false if javaThread is null in Thread::Runnable::interrupted

This field may be null if the thread is in the process of being
attached to the VM.
This commit is contained in:
Joel Dice 2011-02-15 21:44:27 -07:00
parent 86c48f3ff6
commit 0bbd11e9be

View File

@ -1500,7 +1500,7 @@ class Thread {
}
virtual bool interrupted() {
return threadInterrupted(t, t->javaThread);
return t->javaThread and threadInterrupted(t, t->javaThread);
}
virtual void setInterrupted(bool v) {
@ -2059,10 +2059,10 @@ attachThread(Machine* m, bool daemon)
addThread(t, t);
uintptr_t arguments[] = { daemon };
enter(t, Thread::ActiveState);
uintptr_t arguments[] = { daemon };
if (run(t, initAttachedThread, arguments)) {
enter(t, Thread::IdleState);
return t;