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 <anchao@lixiang.com>
This commit is contained in:
chao an 2024-03-11 19:59:08 +08:00 committed by Xiang Xiao
parent 61689237f6
commit be482cd830
2 changed files with 2 additions and 2 deletions

View file

@ -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);

View file

@ -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.