MCPcopy Index your code
hub / github.com/python/cpython / release

Method release

Lib/asyncio/locks.py:428–435  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

426 return True
427
428 def release(self):
429 """Release a semaphore, incrementing the internal counter by one.
430
431 When it was zero on entry and another task is waiting for it to
432 become larger than zero again, wake up that task.
433 """
434 self._value += 1
435 self._wake_up_next()
436
437 def _wake_up_next(self):
438 """Wake up the first waiter that isn't done."""

Callers 12

test_semaphoreMethod · 0.95
test_acquireMethod · 0.95
test_acquire_hangMethod · 0.95
test_saturationMethod · 0.95
test_saturationMethod · 0.95

Calls 1

_wake_up_nextMethod · 0.95

Tested by 12

test_semaphoreMethod · 0.76
test_acquireMethod · 0.76
test_acquire_hangMethod · 0.76
test_saturationMethod · 0.76
test_saturationMethod · 0.76