Note! This project has moved to github.com/armmbed/mbed-events
This repository has been superceded
This project has moved to mbed-events
Composable event loops combine the cheap synchronicity of event loops with the composability of preempted threads.
Two modular event queue classes are provided:
- EventLoop - for loops coupled with a c++ managed thread
- EventQueue - for manually managed event queues
The Event class takes advantage of the extensibility of FuncPtr to allow an event to be passed through APIs as a normal function.
More information on composable event loops.
Diff: EventQueue.h
- Revision:
- 20:2f9d9c53a5af
- Parent:
- 19:86ffaa34870b
--- a/EventQueue.h Mon Apr 18 12:59:37 2016 -0500 +++ b/EventQueue.h Mon Apr 18 13:22:21 2016 -0500 @@ -17,10 +17,15 @@ public: /** Create an event queue * @param event_count Number of events to allow enqueueing at once + * (default: 32) * @param event_context Max size of arguments passed with an event + * (default: 0) + * @param event_pointer Pointer to memory area to be used for events + * (default: NULL) */ EventQueue(unsigned event_count=32, - unsigned event_context=0); + unsigned event_context=0, + unsigned char *event_pointer=NULL); /** Clean up event queue */ @@ -79,6 +84,7 @@ unsigned _event_context; void *_mem; + struct event *volatile _free; struct event *volatile _queue;