(self, obj, block=True, timeout=None)
| 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: |