MCPcopy Index your code
hub / github.com/RustPython/RustPython / _write_msg_thread

Method _write_msg_thread

Lib/test/test_queue.py:319–341  ·  view source on GitHub ↗
(self, q, n, results,
                            i_when_exec_shutdown, event_shutdown,
                            barrier_start)

Source from the content-addressed store, hash-verified

317 return self._shutdown_all_methods_in_one_thread(True)
318
319 def _write_msg_thread(self, q, n, results,
320 i_when_exec_shutdown, event_shutdown,
321 barrier_start):
322 # All `write_msg_threads`
323 # put several items into the queue.
324 for i in range(0, i_when_exec_shutdown//2):
325 q.put((i, 'LOYD'))
326 # Wait for the barrier to be complete.
327 barrier_start.wait()
328
329 for i in range(i_when_exec_shutdown//2, n):
330 try:
331 q.put((i, "YDLO"))
332 except self.queue.ShutDown:
333 results.append(False)
334 break
335
336 # Trigger queue shutdown.
337 if i == i_when_exec_shutdown:
338 # Only one thread should call shutdown().
339 if not event_shutdown.is_set():
340 event_shutdown.set()
341 results.append(True)
342
343 def _read_msg_thread(self, q, results, barrier_start):
344 # Get at least one item.

Callers

nothing calls this directly

Calls 5

putMethod · 0.45
waitMethod · 0.45
appendMethod · 0.45
is_setMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected