fix failure to remove thread from wait list in System::Monitor::notifyAll()

This commit is contained in:
Joel Dice 2007-07-29 19:18:18 -06:00
parent 5e336544f5
commit 73155c6196
2 changed files with 4 additions and 8 deletions

View File

@ -16,7 +16,7 @@ src = src
classpath = classpath classpath = classpath
test = test test = test
input = $(cls)/Exceptions.class input = $(cls)/Threads.class
cxx = g++ cxx = g++
cc = gcc cc = gcc

View File

@ -288,6 +288,7 @@ class MySystem: public System {
} }
t->flags = 0; t->flags = 0;
t->next = 0;
if (t->r->interrupted()) { if (t->r->interrupted()) {
t->r->setInterrupted(false); t->r->setInterrupted(false);
@ -330,15 +331,10 @@ class MySystem: public System {
Thread* t = static_cast<Thread*>(context); Thread* t = static_cast<Thread*>(context);
if (owner_ == t) { if (owner_ == t) {
for (Thread** p = &first; *p;) { for (Thread* t = first; t; t = t->next) {
Thread* t = *p;
p = &(t->next);
if (t == last) {
last = 0;
}
doNotify(t); doNotify(t);
} }
first = last = 0;
} else { } else {
sysAbort(s); sysAbort(s);
} }