Commit 721caafb authored by David Wilson's avatar David Wilson

core: Do not decrement Latch._waking if we weren't woken.

parent f6c24ab6
......@@ -954,8 +954,9 @@ class Latch(object):
try:
i = self._sleeping.index(_tls.wsock)
del self._sleeping[i]
self._waking -= 1
if i > self._waking:
if i < self._waking:
self._waking -= 1
else:
raise TimeoutError()
if _tls.rsock.recv(2) != '\x7f':
raise LatchError('internal error: received >1 wakeups')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment