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

Method notify

Lib/asyncio/locks.py:317–331  ·  view source on GitHub ↗

By default, wake up one task waiting on this condition, if any. If the calling task has not acquired the lock when this method is called, a RuntimeError is raised. This method wakes up n of the tasks waiting for the condition variable; if fewer than n are waiting, t

(self, n=1)

Source from the content-addressed store, hash-verified

315 return result
316
317 def notify(self, n=1):
318 """By default, wake up one task waiting on this condition, if any.
319 If the calling task has not acquired the lock when this method
320 is called, a RuntimeError is raised.
321
322 This method wakes up n of the tasks waiting for the condition
323 variable; if fewer than n are waiting, they are all awoken.
324
325 Note: an awakened task does not actually return from its
326 wait() call until it can reacquire the lock. Since notify() does
327 not release the lock, its caller should.
328 """
329 if not self.locked():
330 raise RuntimeError('cannot notify on un-acquired lock')
331 self._notify(n)
332
333 def _notify(self, n):
334 idx = 0

Callers 15

notify_allMethod · 0.95
test_notifyMethod · 0.95
test_notify_nMethod · 0.95
test_waitforMethod · 0.95
test_waitfor_timeoutMethod · 0.95
test_waitMethod · 0.95
test_wait_forMethod · 0.95
test_notifyMethod · 0.95
test_cancelled_wakeupMethod · 0.95

Calls 2

_notifyMethod · 0.95
lockedMethod · 0.45

Tested by 15

test_notifyMethod · 0.76
test_notify_nMethod · 0.76
test_waitforMethod · 0.76
test_waitfor_timeoutMethod · 0.76
test_waitMethod · 0.76
test_wait_forMethod · 0.76
test_notifyMethod · 0.76
test_cancelled_wakeupMethod · 0.76