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.
Diff: platform/SingletonPtr.h
- Revision:
- 145:64910690c574
- Parent:
- 128:9bcdf88f62b0
diff -r 0f02307a0877 -r 64910690c574 platform/SingletonPtr.h --- a/platform/SingletonPtr.h Thu Jun 08 14:53:05 2017 +0100 +++ b/platform/SingletonPtr.h Wed Jun 21 17:31:38 2017 +0100 @@ -23,11 +23,11 @@ #include <new> #include "platform/mbed_assert.h" #ifdef MBED_CONF_RTOS_PRESENT -#include "cmsis_os.h" +#include "cmsis_os2.h" #endif #ifdef MBED_CONF_RTOS_PRESENT -extern osMutexId singleton_mutex_id; +extern osMutexId_t singleton_mutex_id; #endif /** Lock the singleton mutex @@ -39,7 +39,7 @@ inline static void singleton_lock(void) { #ifdef MBED_CONF_RTOS_PRESENT - osMutexWait(singleton_mutex_id, osWaitForever); + osMutexAcquire(singleton_mutex_id, osWaitForever); #endif } @@ -55,18 +55,20 @@ osMutexRelease (singleton_mutex_id); #endif } +/** @}*/ /** Utility class for creating an using a singleton * - * @Note Synchronization level: Thread safe + * @note Synchronization level: Thread safe * - * @Note: This class must only be used in a static context - + * @note: This class must only be used in a static context - * this class must never be allocated or created on the * stack. * - * @Note: This class is lazily initialized on first use. + * @note: This class is lazily initialized on first use. * This class is a POD type so if it is not used it will * be garbage collected. + * @ingroup platform */ template <class T> struct SingletonPtr { @@ -107,4 +109,3 @@ #endif -/** @}*/