summaryrefslogtreecommitdiff
path: root/components/libc
diff options
context:
space:
mode:
authorYonggang Luo <[email protected]>2025-09-22 01:04:46 +0800
committerR b b666 <[email protected]>2025-09-24 18:12:36 +0800
commit66b2bcc080b39750cc69a2f00f0d951f94967712 (patch)
tree8b93349cd771af71a55bfce5b0afe87cf296e2cf /components/libc
parent5bba332e23c6d5e859b4fe00cc5aea5ea6e26a73 (diff)
RT_TIMER_CTRL_SET_TIME only accept rt_tick_t, pass rt_tick_t instead int/rt_int32_t
Diffstat (limited to 'components/libc')
-rw-r--r--components/libc/posix/io/epoll/epoll.c3
-rw-r--r--components/libc/posix/io/poll/poll.c3
-rw-r--r--components/libc/posix/pthreads/pthread_cond.c3
3 files changed, 6 insertions, 3 deletions
diff --git a/components/libc/posix/io/epoll/epoll.c b/components/libc/posix/io/epoll/epoll.c
index 7677b8deea..a4c9dcfc06 100644
--- a/components/libc/posix/io/epoll/epoll.c
+++ b/components/libc/posix/io/epoll/epoll.c
@@ -700,9 +700,10 @@ static int epoll_wait_timeout(struct rt_eventpoll *ep, int msec)
{
if (timeout > 0)
{
+ rt_tick_t timeout_tick = timeout;
rt_timer_control(&(thread->thread_timer),
RT_TIMER_CTRL_SET_TIME,
- &timeout);
+ &timeout_tick);
rt_timer_start(&(thread->thread_timer));
}
diff --git a/components/libc/posix/io/poll/poll.c b/components/libc/posix/io/poll/poll.c
index 8be654ed3b..3667216081 100644
--- a/components/libc/posix/io/poll/poll.c
+++ b/components/libc/posix/io/poll/poll.c
@@ -158,9 +158,10 @@ static int poll_wait_timeout(struct rt_poll_table *pt, int msec)
{
if (timeout > 0)
{
+ rt_tick_t timeout_tick = timeout;
rt_timer_control(&(thread->thread_timer),
RT_TIMER_CTRL_SET_TIME,
- &timeout);
+ &timeout_tick);
rt_timer_start(&(thread->thread_timer));
rt_set_errno(RT_ETIMEOUT);
}
diff --git a/components/libc/posix/pthreads/pthread_cond.c b/components/libc/posix/pthreads/pthread_cond.c
index caedec7601..69cad1fa2e 100644
--- a/components/libc/posix/pthreads/pthread_cond.c
+++ b/components/libc/posix/pthreads/pthread_cond.c
@@ -418,10 +418,11 @@ rt_err_t _pthread_cond_timedwait(pthread_cond_t *cond,
/* has waiting time, start thread timer */
if (time > 0)
{
+ rt_tick_t time_tick = time;
/* reset the timeout of thread timer and start it */
rt_timer_control(&(thread->thread_timer),
RT_TIMER_CTRL_SET_TIME,
- &time);
+ &time_tick);
rt_timer_start(&(thread->thread_timer));
}