ThreadEvent
Event object for event notification and signal passing between multiple threads.
set
The set() function is used to set an event signal.
set()Examples
Please refer to the examples in the threading.Event() section.
See Also
Remarks
If the event has already been set via set(), it cannot be set again. You need to call the clear operation first before resetting the signal.
clear
The clear() function is used to clear the signal.
clear()Examples
Please refer to the example in the threading.Event() section.
See Also
wait
The wait() function is used to set event (signal) waiting, which will block until the event (signal) is set; supports setting timeout parameters.
wait()
wait(timeout)Examples
Test the return value of the wait() function.
javascript
function main() {
var event = threading.Event()
var t1 = threading.Thread(function(event) {
var ret = event.wait(100)
Log(`event.wait(100):`, ret)
ret = event.wait()
Log(`event.wait():`, ret)
}, event)
Sleep(1000)
event.set()
t1.join()
}Returns
| Type | Description |
bool | The |
Arguments
| Name | Type | Required | Description |
timeout | number | No | The parameter |
See Also
isSet
The isSet() function is used to determine whether an event (signal) has been set.
isSet()Examples
Please refer to the examples in the threading.Event() section.
Returns
| Type | Description |
bool | The |
See Also