fix deadlock in allocate3 when another thread wants to enter the exclusive state

This commit is contained in:
Joel Dice 2009-07-16 11:51:35 -06:00
parent 30c7107aa3
commit 9c9eb86b2f

View File

@ -2055,6 +2055,10 @@ allocate3(Thread* t, Allocator* allocator, Machine::AllocationType type,
// another thread wants to enter the exclusive state, either for a
// collection or some other reason. We give it a chance here.
ENTER(t, Thread::IdleState);
while (t->m->exclusive) {
t->m->stateLock->wait(t->systemThread, 0);
}
}
switch (type) {