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): ...@@ -954,8 +954,9 @@ class Latch(object):
try: try:
i = self._sleeping.index(_tls.wsock) i = self._sleeping.index(_tls.wsock)
del self._sleeping[i] del self._sleeping[i]
if i < self._waking:
self._waking -= 1 self._waking -= 1
if i > self._waking: else:
raise TimeoutError() raise TimeoutError()
if _tls.rsock.recv(2) != '\x7f': if _tls.rsock.recv(2) != '\x7f':
raise LatchError('internal error: received >1 wakeups') 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