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
|
||||
DEBUGASSERT(ctcb && ctcb->group);
|
||||
|
||||
/* Keep things stationary throughout the following */
|
||||
|
||||
sched_lock();
|
||||
|
||||
/* Send SIGCHLD to all members of the parent's task group */
|
||||
|
||||
nxtask_sigchild(ctcb->group->tg_ppid, ctcb, status);
|
||||
sched_unlock();
|
||||
#else
|
||||
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
|
||||
* 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 */
|
||||
|
||||
sched_unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -307,7 +297,6 @@ static inline void nxtask_signalparent(FAR struct tcb_s *ctcb, int status)
|
|||
*/
|
||||
|
||||
nxtask_sigchild(ptcb, ctcb, status);
|
||||
sched_unlock();
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
|
|
|
@ -320,19 +320,10 @@ pid_t nxtask_start_fork(FAR struct task_tcb_s *child)
|
|||
|
||||
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 */
|
||||
|
||||
nxtask_activate((FAR struct tcb_s *)child);
|
||||
|
||||
sched_unlock();
|
||||
return pid;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue