The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Revision:
122:f9eeca106725
Parent:
93:e188a91d3eaa
Child:
123:b0220dba8be7
diff -r 6c34061e7c34 -r f9eeca106725 BusIn.h
--- a/BusIn.h	Wed May 25 16:44:06 2016 +0100
+++ b/BusIn.h	Thu Jul 07 14:34:11 2016 +0100
@@ -22,6 +22,8 @@
 namespace mbed {
 
 /** A digital input bus, used for reading the state of a collection of pins
+ *
+ * @Note Synchronization level: Thread safe
  */
 class BusIn {
 
@@ -65,6 +67,7 @@
      *    Binary mask of connected pins
      */
     int mask() {
+        // No lock needed since _nc_mask is not modified outside the constructor
         return _nc_mask;
     }
 
@@ -87,8 +90,12 @@
      */
     int _nc_mask;
 
+    PlatformMutex _mutex;
+
     /* disallow copy constructor and assignment operators */
 private:
+    virtual void lock();
+    virtual void unlock();
     BusIn(const BusIn&);
     BusIn & operator = (const BusIn&);
 };