sched/task: There is no need to use sched_[un]lock
Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
parent
451f9372db
commit
0519dc0235
|
@ -272,21 +272,12 @@ static inline void nxtask_signalparent(FAR struct tcb_s *ctcb, int status)
|
||||||
#ifdef HAVE_GROUP_MEMBERS
|
#ifdef HAVE_GROUP_MEMBERS
|
||||||
DEBUGASSERT(ctcb && ctcb->group);
|
DEBUGASSERT(ctcb && ctcb->group);
|
||||||
|
|
||||||
/* Keep things stationary throughout the following */
|
|
||||||
|
|
||||||
sched_lock();
|
|
||||||
|
|
||||||
/* Send SIGCHLD to all members of the parent's task group */
|
/* Send SIGCHLD to all members of the parent's task group */
|
||||||
|
|
||||||
nxtask_sigchild(ctcb->group->tg_ppid, ctcb, status);
|
nxtask_sigchild(ctcb->group->tg_ppid, ctcb, status);
|
||||||
sched_unlock();
|
|
||||||
#else
|
#else
|
||||||
FAR struct tcb_s *ptcb;
|
FAR struct tcb_s *ptcb;
|
||||||
|
|
||||||
/* Keep things stationary throughout the following */
|
|
||||||
|
|
||||||
sched_lock();
|
|
||||||
|
|
||||||
/* Get the TCB of the receiving, parent task. We do this early to
|
/* Get the TCB of the receiving, parent task. We do this early to
|
||||||
* handle multiple calls to nxtask_signalparent.
|
* handle multiple calls to nxtask_signalparent.
|
||||||
*/
|
*/
|
||||||
|
@ -296,7 +287,6 @@ static inline void nxtask_signalparent(FAR struct tcb_s *ctcb, int status)
|
||||||
{
|
{
|
||||||
/* The parent no longer exists... bail */
|
/* The parent no longer exists... bail */
|
||||||
|
|
||||||
sched_unlock();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -307,7 +297,6 @@ static inline void nxtask_signalparent(FAR struct tcb_s *ctcb, int status)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
nxtask_sigchild(ptcb, ctcb, status);
|
nxtask_sigchild(ptcb, ctcb, status);
|
||||||
sched_unlock();
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -320,19 +320,10 @@ pid_t nxtask_start_fork(FAR struct task_tcb_s *child)
|
||||||
|
|
||||||
pid = child->cmn.pid;
|
pid = child->cmn.pid;
|
||||||
|
|
||||||
/* Eliminate a race condition by disabling pre-emption. The child task
|
|
||||||
* can be instantiated, but cannot run until we call waitpid(). This
|
|
||||||
* assures us that we cannot miss the death-of-child signal (only
|
|
||||||
* needed in the SMP case).
|
|
||||||
*/
|
|
||||||
|
|
||||||
sched_lock();
|
|
||||||
|
|
||||||
/* Activate the task */
|
/* Activate the task */
|
||||||
|
|
||||||
nxtask_activate((FAR struct tcb_s *)child);
|
nxtask_activate((FAR struct tcb_s *)child);
|
||||||
|
|
||||||
sched_unlock();
|
|
||||||
return pid;
|
return pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue