Skip to content

Commit c63a627

Browse files
committed
Protect local static object construction in ARMCC
Implement the functions __cxa_guard_acquire, __cxa_guard_release and __cxa_guard_abort for ARMCC so local static object construction is thread safe.
1 parent 1faf46e commit c63a627

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

platform/mbed_retarget.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,10 @@ extern "C" void __env_unlock( struct _reent *_r )
977977
__rtos_env_unlock(_r);
978978
}
979979

980+
#endif
981+
982+
#if defined (__GNUC__) || defined(__CC_ARM) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
983+
980984
#define CXA_GUARD_INIT_DONE (1 << 0)
981985
#define CXA_GUARD_INIT_IN_PROGRESS (1 << 1)
982986
#define CXA_GUARD_MASK (CXA_GUARD_INIT_DONE | CXA_GUARD_INIT_IN_PROGRESS)

0 commit comments

Comments
 (0)