Note! This project has moved to github.com/armmbed/mbed-events

Dependents:   SimpleHTTPExample

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.

Revision:
7:dcd589b578ca
Parent:
6:31c141d3bcc7
Child:
9:2b0910397844
--- a/EventQueue.cpp	Wed Apr 20 23:07:47 2016 -0500
+++ b/EventQueue.cpp	Thu Apr 21 04:36:39 2016 -0500
@@ -77,9 +77,7 @@
     event->next = *p;
     *p = event;
 
-    if (!primask) {
-        __enable_irq();
-    }
+    __set_PRIMASK(primask);
 }
 
 void EventQueue::event_unregister(struct event *event) {
@@ -93,8 +91,6 @@
         }
     }
 
-    if (!primask) {
-        __enable_irq();
-    }
+    __set_PRIMASK(primask);
 }