userspace CONDITION-WAIT and interrupts
GC and signals cause WITHOUT-THREAD-WAITING-FOR to mark the thread as
temporarily not waiting for anything, restoring the old status on unwind.
This is fine for mutex deadlock detection, but now that the same slot is
used for userspace condition variable wakeups we end up in trouble:
T1: enqueue self on waitqueue, marked as waiting on it.
T1: receives an interrupt and is marked as not waiting anymore while the
interrupt is handled.
T2: delivers a wakeup to the queue, sees T1 as not waiting anymore and
drops it from the queue.
T1: resumes waiting, but isn't on the queue, and never receives a wakeup.
Extra Bonus:
If T1 times out or unwinds for any reason, it sees itself as not having
been woken up, and with interrupts disabled tries to unqueue itself
from the queue -- ending up in an uninterruptible endless loop.
The Fix:
WITHOUT-THREAD-WAITING-FOR no longer restores the waiting-for information
for waitqueues, effectively causing a bogus wakeup.