mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Revision:
188:bcfe06ba3d64
Parent:
187:0387e8f68319
Child:
189:f392fc9709a3
--- a/platform/SingletonPtr.h	Thu Sep 06 13:40:20 2018 +0100
+++ b/platform/SingletonPtr.h	Thu Nov 08 11:46:34 2018 +0000
@@ -43,6 +43,10 @@
 inline static void singleton_lock(void)
 {
 #ifdef MBED_CONF_RTOS_PRESENT
+    if (!singleton_mutex_id) {
+        // RTOS has not booted yet so no mutex is needed
+        return;
+    }
     osMutexAcquire(singleton_mutex_id, osWaitForever);
 #endif
 }
@@ -56,6 +60,10 @@
 inline static void singleton_unlock(void)
 {
 #ifdef MBED_CONF_RTOS_PRESENT
+    if (!singleton_mutex_id) {
+        // RTOS has not booted yet so no mutex is needed
+        return;
+    }
     osMutexRelease(singleton_mutex_id);
 #endif
 }