summaryrefslogtreecommitdiff
path: root/components/libc/pthreads
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2021-07-31 08:29:22 +0800
committerGitHub <[email protected]>2021-07-31 08:29:22 +0800
commitc3dab99463514b844099310e997d9d1cea0b8017 (patch)
treeb5e2532d6754225788a091c8777347b55fba0ccf /components/libc/pthreads
parent7de647c7263c227ba377bd477d969516840c7c6f (diff)
parent2589d245325d95f0291e27886f93644d1f762f53 (diff)
Merge pull request #4880 from mysterywolf/tz
[libc][time] 修复若干问题
Diffstat (limited to 'components/libc/pthreads')
-rw-r--r--components/libc/pthreads/mqueue.c2
-rw-r--r--components/libc/pthreads/pthread_cond.c2
-rw-r--r--components/libc/pthreads/semaphore.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/components/libc/pthreads/mqueue.c b/components/libc/pthreads/mqueue.c
index a59c7a445b..6840164a68 100644
--- a/components/libc/pthreads/mqueue.c
+++ b/components/libc/pthreads/mqueue.c
@@ -244,7 +244,7 @@ ssize_t mq_timedreceive(mqd_t mqdes,
return -1;
}
- tick = clock_time_to_tick(abs_timeout);
+ tick = rt_timespec_to_tick(abs_timeout);
result = rt_mq_recv(mqdes->mq, msg_ptr, msg_len, tick);
if (result == RT_EOK)
diff --git a/components/libc/pthreads/pthread_cond.c b/components/libc/pthreads/pthread_cond.c
index 59c271bf6e..9bf49704ed 100644
--- a/components/libc/pthreads/pthread_cond.c
+++ b/components/libc/pthreads/pthread_cond.c
@@ -222,7 +222,7 @@ int pthread_cond_timedwait(pthread_cond_t *cond,
int timeout;
rt_err_t result;
- timeout = clock_time_to_tick(abstime);
+ timeout = rt_timespec_to_tick(abstime);
result = _pthread_cond_timedwait(cond, mutex, timeout);
if (result == RT_EOK)
return 0;
diff --git a/components/libc/pthreads/semaphore.c b/components/libc/pthreads/semaphore.c
index 199b33bfe8..5e59ae850f 100644
--- a/components/libc/pthreads/semaphore.c
+++ b/components/libc/pthreads/semaphore.c
@@ -319,7 +319,7 @@ int sem_timedwait(sem_t *sem, const struct timespec *abs_timeout)
return EINVAL;
/* calculate os tick */
- tick = clock_time_to_tick(abs_timeout);
+ tick = rt_timespec_to_tick(abs_timeout);
result = rt_sem_take(sem->sem, tick);
if (result == -RT_ETIMEOUT)