libc/time: don't take semaphore in idle task

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
Jiuzhu Dong 2022-08-11 22:12:30 +08:00 committed by Xiang Xiao
parent 6978446b8e
commit 0bff62e3e8

View File

@ -1768,7 +1768,7 @@ static FAR struct tm *gmtsub(FAR const time_t *timep,
if (!g_gmt_isset)
{
#ifndef __KERNEL__
if (up_interrupt_context())
if (up_interrupt_context() || sched_idletask())
{
return NULL;
}
@ -2486,7 +2486,7 @@ void tzset(void)
FAR const char *name;
#ifndef __KERNEL__
if (up_interrupt_context())
if (up_interrupt_context() || sched_idletask())
{
return;
}