Set the internal flag to ``True``. All waiters are awakened. Calling `.wait` once the flag is set will not block.
(self)
| 210 | return self._value |
| 211 | |
| 212 | def set(self) -> None: |
| 213 | """Set the internal flag to ``True``. All waiters are awakened. |
| 214 | |
| 215 | Calling `.wait` once the flag is set will not block. |
| 216 | """ |
| 217 | if not self._value: |
| 218 | self._value = True |
| 219 | |
| 220 | for fut in self._waiters: |
| 221 | if not fut.done(): |
| 222 | fut.set_result(None) |
| 223 | |
| 224 | def clear(self) -> None: |
| 225 | """Reset the internal flag to ``False``. |