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

Method set

Lib/asyncio/locks.py:182–192  ·  view source on GitHub ↗

Set the internal flag to true. All tasks waiting for it to become true are awakened. Tasks that call wait() once the flag is true will not block at all.

(self)

Source from the content-addressed store, hash-verified

180 return self._value
181
182 def set(self):
183 """Set the internal flag to true. All tasks waiting for it to
184 become true are awakened. Tasks that call wait() once the flag is
185 true will not block at all.
186 """
187 if not self._value:
188 self._value = True
189
190 for fut in self._waiters:
191 if not fut.done():
192 fut.set_result(True)
193
194 def clear(self):
195 """Reset the internal flag to false. Subsequently, tasks calling

Callers 15

run_one_coroFunction · 0.95
staggered_raceFunction · 0.95
exportMethod · 0.95
_shutdown_getMethod · 0.95
_shutdown_putMethod · 0.95
_shutdown_joinMethod · 0.95
_shutdown_put_joinMethod · 0.95
test_syslog_threadedMethod · 0.95
test_current_framesMethod · 0.95

Calls 2

doneMethod · 0.45
set_resultMethod · 0.45

Tested by 15

_shutdown_getMethod · 0.76
_shutdown_putMethod · 0.76
_shutdown_joinMethod · 0.76
_shutdown_put_joinMethod · 0.76
test_syslog_threadedMethod · 0.76
test_current_framesMethod · 0.76