core: Make Latch.put(obj=) optional.

pull/564/head
David Wilson 6 years ago
parent d865fb797d
commit ca63c26e01

@ -2240,11 +2240,14 @@ class Latch(object):
finally: finally:
self._lock.release() self._lock.release()
def put(self, obj): def put(self, obj=None):
""" """
Enqueue an object, waking the first thread waiting for a result, if one Enqueue an object, waking the first thread waiting for a result, if one
exists. exists.
:param obj:
Object to enqueue. Defaults to :data:`None` as a convenience when
using :class:`Latch` only for synchronization.
:raises mitogen.core.LatchError: :raises mitogen.core.LatchError:
:meth:`close` has been called, and the object is no longer valid. :meth:`close` has been called, and the object is no longer valid.
""" """

Loading…
Cancel
Save