MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / release

Method release

tools/python-3.11.9-amd64/Lib/threading.py:487–499  ·  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

485 __enter__ = acquire
486
487 def release(self, n=1):
488 """Release a semaphore, incrementing the internal counter by one or more.
489
490 When the counter is zero on entry and another thread is waiting for it
491 to become larger than zero again, wake up that thread.
492
493 """
494 if n < 1:
495 raise ValueError('n must be one or more')
496 with self._cond:
497 self._value += n
498 for i in range(n):
499 self._cond.notify()
500
501 def __exit__(self, t, v, tb):
502 self.release()

Callers 1

__exit__Method · 0.95

Calls 1

notifyMethod · 0.45

Tested by

no test coverage detected