Skip to content

Commit ca63c26

Browse files
committed
core: Make Latch.put(obj=) optional.
1 parent d865fb7 commit ca63c26

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mitogen/core.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2240,11 +2240,14 @@ def _get_sleep(self, poller, timeout, block, rsock, wsock, cookie):
22402240
finally:
22412241
self._lock.release()
22422242

2243-
def put(self, obj):
2243+
def put(self, obj=None):
22442244
"""
22452245
Enqueue an object, waking the first thread waiting for a result, if one
22462246
exists.
22472247
2248+
:param obj:
2249+
Object to enqueue. Defaults to :data:`None` as a convenience when
2250+
using :class:`Latch` only for synchronization.
22482251
:raises mitogen.core.LatchError:
22492252
:meth:`close` has been called, and the object is no longer valid.
22502253
"""

0 commit comments

Comments
 (0)