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.cpp
- Revision:
- 9:2b0910397844
- Parent:
- 7:dcd589b578ca
- Child:
- 10:62767e708bb6
--- a/EventQueue.cpp Fri Apr 22 02:06:42 2016 -0500 +++ b/EventQueue.cpp Fri Apr 22 02:21:25 2016 -0500 @@ -1,6 +1,10 @@ #include "EventQueue.h" #include "Event.h" +#ifndef EVENTS_NO_RTOS +#include "rtos.h" +#endif + EventQueue::EventQueue() { _queue = 0; @@ -54,7 +58,11 @@ } } +#ifndef EVENTS_NO_RTOS + Thread::yield(); +#else __WFI(); +#endif } }