sionescu/bordeaux-threads — pull request #4 by lmj (2013-10-28 00:23:27+00:00)
Title: SBCL: reacquire lock in CONDITION-WAIT on timeout

For a `condition-wait` timeout expiring, SBCL appears to be the only implementation that returns without the lock being held. Reacquiring the lock inside `condition-wait` is the most obvious solution. The alternative would be to tell users that the lock state is unknown and provide `lock-acquired-p`. It would seem unintuitive that a lock is not necessarily held inside `with-lock-held`.

I can see a reason for SBCL doing this -- if the timeout expires then one is likely to give up whatever activity was needed for the lock. However if that activity is, say, consuming data, then it can't hurt trying to consume one last time, so reacquiring the lock need not be a total waste.