mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 01:21:26 +08:00
libc/time: don't take semaphore in idle task
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
@@ -1768,7 +1768,7 @@ static FAR struct tm *gmtsub(FAR const time_t *timep,
|
|||||||
if (!g_gmt_isset)
|
if (!g_gmt_isset)
|
||||||
{
|
{
|
||||||
#ifndef __KERNEL__
|
#ifndef __KERNEL__
|
||||||
if (up_interrupt_context())
|
if (up_interrupt_context() || sched_idletask())
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -2486,7 +2486,7 @@ void tzset(void)
|
|||||||
FAR const char *name;
|
FAR const char *name;
|
||||||
|
|
||||||
#ifndef __KERNEL__
|
#ifndef __KERNEL__
|
||||||
if (up_interrupt_context())
|
if (up_interrupt_context() || sched_idletask())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user