Return a pointer to an EventQueue, on which normal tasks can be queued.
All calls to this return the same EventQueue - it and its dispatch thread are created on the first call to this function. The dispatch thread runs at default priority (currently osPriorityNormal).
The EventQueue returned may be used to call() Events, or to chain() other EventQueues so that they are run in the same context.
Events (or chained EventQueues) executing on the normal event queue should normally take less than 10ms to execute, to avoid starving other users. As such, users can expect that event latency will typically be 10ms or less, but could occasionally be significantly higher if many events are queued.
If an RTOS is not present or the configuration option
events.shared-dispatch-from-application is set to true, then this does not create a dedicated dispatch thread - instead the application is expected to run the EventQueue's dispatch, for example from main. This is necessary for the event loop to work without an RTOS, or an RTOS system can save memory by reusing the main stack.
- mbed_event_queue is not itself IRQ safe. To use the mbed_event_queue in interrupt context, you must first call
mbed_event_queue() in threaded context and store the pointer for later use.
- pointer to event queue