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

Method release

Lib/threading.py:529–540  ·  view source on GitHub ↗

Release a semaphore, incrementing the internal counter by one or more. When the counter is zero on entry and another thread is waiting for it to become larger than zero again, wake up that thread.

(self, n=1)

Source from the content-addressed store, hash-verified

527 __enter__ = acquire
528
529 def release(self, n=1):
530 """Release a semaphore, incrementing the internal counter by one or more.
531
532 When the counter is zero on entry and another thread is waiting for it
533 to become larger than zero again, wake up that thread.
534
535 """
536 if n < 1:
537 raise ValueError('n must be one or more')
538 with self._cond:
539 self._value += n
540 self._cond.notify(n)
541
542 def __exit__(self, t, v, tb):
543 self.release()

Callers 1

__exit__Method · 0.95

Calls 1

notifyMethod · 0.45

Tested by

no test coverage detected