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

Method sleeper_gen

Lib/test/test_gc.py:473–478  ·  view source on GitHub ↗

A generator that releases the GIL when closed or dealloc'ed.

()

Source from the content-addressed store, hash-verified

471 N_THREADS = 2
472
473 def sleeper_gen():
474 """A generator that releases the GIL when closed or dealloc'ed."""
475 try:
476 yield
477 finally:
478 time.sleep(0.000001)
479
480 class C(list):
481 # Appending to a list is atomic, which avoids the use of a lock.

Callers

nothing calls this directly

Calls 1

sleepMethod · 0.45

Tested by

no test coverage detected