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.
pull/5738/head
Russ Butler 2017-12-01 10:47:18 -06:00 committed by adbridge
parent e97b38f804
commit 0493ba2bfe
1 changed files with 4 additions and 0 deletions

View File

@ -977,6 +977,10 @@ extern "C" void __env_unlock( struct _reent *_r )
__rtos_env_unlock(_r);
}
#endif
#if defined (__GNUC__) || defined(__CC_ARM) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
#define CXA_GUARD_INIT_DONE (1 << 0)
#define CXA_GUARD_INIT_IN_PROGRESS (1 << 1)
#define CXA_GUARD_MASK (CXA_GUARD_INIT_DONE | CXA_GUARD_INIT_IN_PROGRESS)