From be482cd830d72dd6a3b03840f6ce7698ee34377b Mon Sep 17 00:00:00 2001 From: chao an Date: Mon, 11 Mar 2024 19:59:08 +0800 Subject: [PATCH] sched/pthread: replace pthread_sem_give() to nxsem_post() to unify the post method replace pthread_sem_give() to nxsem_post() to unify the post method Signed-off-by: chao an --- sched/pthread/pthread_completejoin.c | 2 +- sched/pthread/pthread_join.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sched/pthread/pthread_completejoin.c b/sched/pthread/pthread_completejoin.c index 42656c17056..e87455ab1e8 100644 --- a/sched/pthread/pthread_completejoin.c +++ b/sched/pthread/pthread_completejoin.c @@ -73,7 +73,7 @@ static bool pthread_notifywaiters(FAR struct join_s *pjoin) do { - status = pthread_sem_give(&pjoin->exit_sem); + status = nxsem_post(&pjoin->exit_sem); if (status == OK) { status = nxsem_get_value(&pjoin->exit_sem, &ntasks_waiting); diff --git a/sched/pthread/pthread_join.c b/sched/pthread/pthread_join.c index 9c27cde9aa9..90c187deee2 100644 --- a/sched/pthread/pthread_join.c +++ b/sched/pthread/pthread_join.c @@ -187,7 +187,7 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value) * will know that we have received the data. */ - pthread_sem_give(&pjoin->data_sem); + nxsem_post(&pjoin->data_sem); /* Retake the join semaphore, we need to hold this when * pthread_destroyjoin is called.