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)
| 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 |