From 090cd8a2091cbbf6bf45f124df27a98525cb1a48 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Thu, 17 Jan 2008 18:32:07 -0700 Subject: [PATCH] re-enter active state before throwing exception in wait() --- src/machine.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/machine.h b/src/machine.h index d62dd7ddbd..dcf771f148 100644 --- a/src/machine.h +++ b/src/machine.h @@ -2049,9 +2049,11 @@ wait(Thread* t, object o, int64_t milliseconds) } if (m and m->owner() == t->systemThread) { - ENTER(t, Thread::IdleState); + bool interrupted; + { ENTER(t, Thread::IdleState); + interrupted = m->wait(t->systemThread, milliseconds); + } - bool interrupted = m->wait(t->systemThread, milliseconds); if (interrupted) { t->exception = makeInterruptedException(t); }