sched: Replace pthread_sem_take with nxsem_wait_uninterruptible
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
0fee5a2b84
commit
08002a0a38
@ -85,7 +85,7 @@ static bool pthread_notifywaiters(FAR struct join_s *pjoin)
|
||||
* value.
|
||||
*/
|
||||
|
||||
pthread_sem_take(&pjoin->data_sem, NULL, false);
|
||||
nxsem_wait_uninterruptible(&pjoin->data_sem);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -196,7 +196,7 @@ int pthread_completejoin(pid_t pid, FAR void *exit_value)
|
||||
|
||||
/* First, find thread's structure in the private data set. */
|
||||
|
||||
pthread_sem_take(&group->tg_joinsem, NULL, false);
|
||||
nxsem_wait_uninterruptible(&group->tg_joinsem);
|
||||
pjoin = pthread_findjoininfo(group, pid);
|
||||
if (!pjoin)
|
||||
{
|
||||
|
@ -569,7 +569,7 @@ int nx_pthread_create(pthread_trampoline_t trampoline, FAR pthread_t *thread,
|
||||
sched_lock();
|
||||
if (ret == OK)
|
||||
{
|
||||
pthread_sem_take(&ptcb->cmn.group->tg_joinsem, NULL, false);
|
||||
nxsem_wait_uninterruptible(&ptcb->cmn.group->tg_joinsem);
|
||||
pthread_addjoininfo(ptcb->cmn.group, pjoin);
|
||||
pthread_sem_give(&ptcb->cmn.group->tg_joinsem);
|
||||
nxtask_activate((FAR struct tcb_s *)ptcb);
|
||||
|
@ -72,7 +72,7 @@ int pthread_detach(pthread_t thread)
|
||||
|
||||
/* Find the entry associated with this pthread. */
|
||||
|
||||
pthread_sem_take(&group->tg_joinsem, NULL, false);
|
||||
nxsem_wait_uninterruptible(&group->tg_joinsem);
|
||||
pjoin = pthread_findjoininfo(group, (pid_t)thread);
|
||||
if (!pjoin)
|
||||
{
|
||||
|
@ -100,7 +100,7 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value)
|
||||
* because it will also attempt to get this semaphore.
|
||||
*/
|
||||
|
||||
pthread_sem_take(&group->tg_joinsem, NULL, false);
|
||||
nxsem_wait_uninterruptible(&group->tg_joinsem);
|
||||
|
||||
/* Find the join information associated with this thread.
|
||||
* This can fail for one of three reasons: (1) There is no
|
||||
@ -199,7 +199,7 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value)
|
||||
* pthread to exit.
|
||||
*/
|
||||
|
||||
pthread_sem_take(&pjoin->exit_sem, NULL, false);
|
||||
nxsem_wait_uninterruptible(&pjoin->exit_sem);
|
||||
|
||||
/* The thread has exited! Get the thread exit value */
|
||||
|
||||
@ -219,7 +219,7 @@ int pthread_join(pthread_t thread, FAR pthread_addr_t *pexit_value)
|
||||
* pthread_destroyjoin is called.
|
||||
*/
|
||||
|
||||
pthread_sem_take(&group->tg_joinsem, NULL, false);
|
||||
nxsem_wait_uninterruptible(&group->tg_joinsem);
|
||||
}
|
||||
|
||||
/* Pre-emption is okay now. The logic still cannot be re-entered
|
||||
|
Loading…
Reference in New Issue
Block a user