Commit cdf158a8 authored by Guido Trotter's avatar Guido Trotter
Browse files

Remove locking._CountingCondition

This class is unused and untested. We must have forgot it around.
Signed-off-by: default avatarGuido Trotter <>
Reviewed-by: default avatarMichael Hanselmann <>
parent 6abf7f2c
...@@ -384,54 +384,6 @@ class PipeCondition(_BaseCondition): ...@@ -384,54 +384,6 @@ class PipeCondition(_BaseCondition):
return bool(self._nwaiters) return bool(self._nwaiters)
class _CountingCondition(object):
"""Wrapper for Python's built-in threading.Condition class.
This wrapper keeps a count of active waiters. We can't access the internal
"__waiters" attribute of threading.Condition because it's not thread-safe.
__slots__ = [
def __init__(self, lock):
"""Initializes this class.
self._cond = threading.Condition(lock=lock)
self._nwaiters = 0
def notifyAll(self): # pylint: disable-msg=C0103
"""Notifies the condition.
return self._cond.notifyAll()
def wait(self, timeout=None):
"""Waits for the condition to be notified.
@type timeout: float or None
@param timeout: Waiting timeout (can be None)
assert self._nwaiters >= 0
self._nwaiters += 1
return self._cond.wait(timeout=timeout)
self._nwaiters -= 1
def has_waiting(self):
"""Returns whether there are active waiters.
return bool(self._nwaiters)
class SharedLock(object): class SharedLock(object):
"""Implements a shared lock. """Implements a shared lock.
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