Merge pull request #5164 from Guozhanxin/cpp11_armclang

This commit is contained in:
guo 2021-10-14 07:57:24 +08:00 committed by GitHub
commit ba5c623139
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -7,7 +7,7 @@ config RT_USING_CPLUSPLUS
if RT_USING_CPLUSPLUS
config RT_USING_CPLUSPLUS11
bool "Enable c++11 feature support"
bool "Enable c++11 threading feature support"
default n
select RT_USING_LIBC
select RT_USING_DFS

View File

@ -73,7 +73,19 @@ extern "C" void __ARM_TPL_thread_yield()
extern "C" int __ARM_TPL_thread_nanosleep(const __ARM_TPL_timespec_t *__req,
__ARM_TPL_timespec_t *__rem)
{
return nanosleep(__req, rem);
rt_tick_t tick;
tick = __req->tv_sec * RT_TICK_PER_SECOND + (__req->tv_nsec * RT_TICK_PER_SECOND)/ 1000000000;
rt_thread_delay(tick);
if (__rem)
{
tick = rt_tick_get() - tick;
/* get the passed time */
__rem->tv_sec = tick/RT_TICK_PER_SECOND;
__rem->tv_nsec = (tick%RT_TICK_PER_SECOND) * (1000000000/RT_TICK_PER_SECOND);
}
return 0;
}
extern "C" unsigned __ARM_TPL_thread_hw_concurrency()