Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Header: #include <applibs/eventloop.h>
Runs an EventLoop and dispatches pending events in the caller's thread of execution.
EventLoop_Run_Result EventLoop_Run(EventLoop *el, int duration_in_milliseconds,
bool process_one_event);
Parameters
elThe EventLoop to run.duration_in_millisecondsThe length of time to run the event loop. If zero, the loop will process one event if one is ready and break immediately, regardless of the value of theprocess_one_eventparameter. If greater than zero, the loop will run for the specified duration unless it is interrupted. If less than zero, the loop will keep running until interrupted. See the EventLoop_Stop function and theprocess_one_eventparameter for additional conditions.process_one_eventIndicates whether to break the loop after the first event is processed. If false, the loop will keep running for the duration specified by theduration_in_millisecondsparameter, or until it is interrupted by EventLoop_Stop. This parameter is ignored ifduration_in_millisecondsis zero.
Return value
Returns an EventLoop_Run_Result value that indicates results of this function call.
Remarks
An application can call EventLoop_Run(el, -1, false) to pass control of the calling thread to the EventLoop.
If the application calls EventLoop_Run(el, -1, true), the loop will block and wait until the first event is ready, then it will process the event and return.
An application can call EventLoop_Stop to exit EventLoop_Run earlier.