|
|
@ -1131,21 +1131,21 @@ class Latch(object):
|
|
|
|
finally:
|
|
|
|
finally:
|
|
|
|
self._lock.release()
|
|
|
|
self._lock.release()
|
|
|
|
|
|
|
|
|
|
|
|
return self._get_sleep(timeout, block, rsock, wsock)
|
|
|
|
poller = self.poller_class()
|
|
|
|
|
|
|
|
poller.start_receive(rsock.fileno())
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
return self._get_sleep(poller, timeout, block, rsock, wsock)
|
|
|
|
|
|
|
|
finally:
|
|
|
|
|
|
|
|
poller.close()
|
|
|
|
|
|
|
|
|
|
|
|
def _get_sleep(self, timeout, block, rsock, wsock):
|
|
|
|
def _get_sleep(self, poller, timeout, block, rsock, wsock):
|
|
|
|
_vv and IOLOG.debug('%r._get_sleep(timeout=%r, block=%r)',
|
|
|
|
_vv and IOLOG.debug('%r._get_sleep(timeout=%r, block=%r)',
|
|
|
|
self, timeout, block)
|
|
|
|
self, timeout, block)
|
|
|
|
e = None
|
|
|
|
e = None
|
|
|
|
poller = self.poller_class()
|
|
|
|
|
|
|
|
poller.start_receive(rsock.fileno())
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
list(poller.poll(timeout))
|
|
|
|
list(poller.poll(timeout))
|
|
|
|
except Exception:
|
|
|
|
except Exception:
|
|
|
|
e = sys.exc_info()[1]
|
|
|
|
e = sys.exc_info()[1]
|
|
|
|
finally:
|
|
|
|
|
|
|
|
poller.close()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self._lock.acquire()
|
|
|
|
self._lock.acquire()
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|