test
Fork of mbed-dev by
Diff: platform/SingletonPtr.h
- Revision:
- 168:e84263d55307
- Parent:
- 149:156823d33999
--- a/platform/SingletonPtr.h Thu Jun 08 15:02:37 2017 +0100 +++ b/platform/SingletonPtr.h Wed Jun 21 17:46:44 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 -/** @}*/