MCPcopy Index your code
hub / github.com/python/cpython / put

Method put

Lib/multiprocessing/queues.py:328–339  ·  view source on GitHub ↗
(self, obj, block=True, timeout=None)

Source from the content-addressed store, hash-verified

326 self._cond, self._unfinished_tasks = state[-2:]
327
328 def put(self, obj, block=True, timeout=None):
329 if self._closed:
330 raise ValueError(f"Queue {self!r} is closed")
331 if not self._sem.acquire(block, timeout):
332 raise Full
333
334 with self._notempty, self._cond:
335 if self._thread is None:
336 self._start_thread()
337 self._buffer.append(obj)
338 self._unfinished_tasks.release()
339 self._notempty.notify()
340
341 def task_done(self):
342 with self._cond:

Callers 1

test_task_doneMethod · 0.95

Calls 5

_start_threadMethod · 0.80
acquireMethod · 0.45
appendMethod · 0.45
releaseMethod · 0.45
notifyMethod · 0.45

Tested by 1

test_task_doneMethod · 0.76