Miosix
2.0alpha1
|
#include <e20.h>
Public Member Functions | |
EventQueue () | |
void | post (std::tr1::function< void()> event) |
void | run () |
void | runOne () |
unsigned int | size () const |
bool | empty () const |
A variable sized event queue.
Makes use of heap allocations and as such it is not possible to post events from within interrupt service routines. For this, use FixedEventQueue.
This class acts as a synchronization point, multiple threads can post events, and multiple threads can call run() or runOne() (thread pooling).
Events are function that are posted by a thread through post() but executed in the context of the thread that calls run() or runOne()
|
inline |
Constructor
|
inline |
void miosix::EventQueue::post | ( | std::tr1::function< void()> | event | ) |
void miosix::EventQueue::run | ( | ) |
This function blocks waiting for events being posted, and when available it calls the event function. To return from this event loop an event function must throw an exception.
any | exception that is thrown by the event functions |
void miosix::EventQueue::runOne | ( | ) |
Run at most one event. This function does not block.
any | exception that is thrown by the event functions |
|
inline |