mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #5635 from c1728p9/fix_lazy_init
Protect local static object construction in ARMCCpull/5693/head
commit
bea41d1ebb
|
@ -58,11 +58,13 @@ static SingletonPtr<TestClass> test_class;
|
||||||
static void main_func_race()
|
static void main_func_race()
|
||||||
{
|
{
|
||||||
get_test_class();
|
get_test_class();
|
||||||
|
TEST_ASSERT_EQUAL_UINT32(1, instance_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void main_class_race()
|
static void main_class_race()
|
||||||
{
|
{
|
||||||
test_class->do_something();
|
test_class->do_something();
|
||||||
|
TEST_ASSERT_EQUAL_UINT32(1, instance_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_case_func_race()
|
void test_case_func_race()
|
||||||
|
|
|
@ -977,6 +977,10 @@ extern "C" void __env_unlock( struct _reent *_r )
|
||||||
__rtos_env_unlock(_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_DONE (1 << 0)
|
||||||
#define CXA_GUARD_INIT_IN_PROGRESS (1 << 1)
|
#define CXA_GUARD_INIT_IN_PROGRESS (1 << 1)
|
||||||
#define CXA_GUARD_MASK (CXA_GUARD_INIT_DONE | CXA_GUARD_INIT_IN_PROGRESS)
|
#define CXA_GUARD_MASK (CXA_GUARD_INIT_DONE | CXA_GUARD_INIT_IN_PROGRESS)
|
||||||
|
|
Loading…
Reference in New Issue