diff options
| author | yangfasheng <[email protected]> | 2023-06-20 23:09:58 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-06-20 23:09:58 +0800 |
| commit | b4e59bac4e2d8b039a2365ddc219ac9a3caf0f77 (patch) | |
| tree | d8fdf234ff4f06c05d2461f575d9568782d661b2 /components/lwp | |
| parent | 3e4797c63c43384825d63166966289bb60b6be78 (diff) | |
dfs v2 修改 fd_new 的 startfd 起始值为 0 ;修复 futex_wait 超时时间换算异常; (#7705)
Signed-off-by: yangfasheng <[email protected]>
Diffstat (limited to 'components/lwp')
| -rw-r--r-- | components/lwp/lwp_futex.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/components/lwp/lwp_futex.c b/components/lwp/lwp_futex.c index 49fe13861c..3d0fda0af6 100644 --- a/components/lwp/lwp_futex.c +++ b/components/lwp/lwp_futex.c @@ -124,7 +124,12 @@ int futex_wait(struct rt_futex *futex, int value, const struct timespec *timeout /* with timeout */ if (timeout) { - rt_int32_t time = rt_timespec_to_tick(timeout); + rt_int32_t time = timeout->tv_sec * RT_TICK_PER_SECOND + timeout->tv_nsec * RT_TICK_PER_SECOND / NANOSECOND_PER_SECOND; + + if (time < 0) + { + time = 0; + } /* start the timer of thread */ rt_timer_control(&(thread->thread_timer), |
