mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 19:36:35 +08:00
sched/signal: Fix remaining time calculation in nxsig_clockwait()
Always compute the expected wake-up time by default, so the remaining time can be calculated correctly when the flag is not TIMER_ABSTIME. Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
This commit is contained in:
committed by
Xiang Xiao
parent
02db473e97
commit
a232815648
@@ -238,19 +238,25 @@ int nxsig_clockwait(int clockid, int flags,
|
|||||||
if ((flags & TIMER_ABSTIME) == 0)
|
if ((flags & TIMER_ABSTIME) == 0)
|
||||||
{
|
{
|
||||||
expect = clock_delay2abstick(clock_time2ticks(rqtp));
|
expect = clock_delay2abstick(clock_time2ticks(rqtp));
|
||||||
wd_start_abstick(&rtcb->waitdog, expect,
|
|
||||||
nxsig_timeout, (uintptr_t)rtcb);
|
|
||||||
}
|
}
|
||||||
else if (clockid == CLOCK_REALTIME)
|
else if (clockid == CLOCK_REALTIME)
|
||||||
{
|
{
|
||||||
wd_start_realtime(&rtcb->waitdog, rqtp,
|
#ifdef CONFIG_CLOCK_TIMEKEEPING
|
||||||
nxsig_timeout, (uintptr_t)rtcb);
|
clock_t delay;
|
||||||
|
|
||||||
|
clock_abstime2ticks(CLOCK_REALTIME, rqtp, &delay);
|
||||||
|
expect = clock_delay2abstick(delay);
|
||||||
|
#else
|
||||||
|
clock_realtime2absticks(rqtp, &expect);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wd_start_abstime(&rtcb->waitdog, rqtp,
|
expect = clock_time2ticks(rqtp);
|
||||||
nxsig_timeout, (uintptr_t)rtcb);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wd_start_abstick(&rtcb->waitdog, expect,
|
||||||
|
nxsig_timeout, (uintptr_t)rtcb);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove the tcb task from the ready-to-run list. */
|
/* Remove the tcb task from the ready-to-run list. */
|
||||||
|
|||||||
Reference in New Issue
Block a user