diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-08-26 22:00:38 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-08-26 22:00:38 +0000 |
commit | ed998bb6ade5c78ec5ba373a5266e193184fc6cc (patch) | |
tree | 17dd760a6289dcf53853dbd7c05f10533dfbccd1 /nuttx/sched | |
parent | ae0c3abd7f9bba4319546ccbbbc42328c185f79e (diff) | |
download | px4-nuttx-ed998bb6ade5c78ec5ba373a5266e193184fc6cc.tar.gz px4-nuttx-ed998bb6ade5c78ec5ba373a5266e193184fc6cc.tar.bz2 px4-nuttx-ed998bb6ade5c78ec5ba373a5266e193184fc6cc.zip |
waitpid(): Move some logic inside of a critical section
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5054 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched')
-rw-r--r-- | nuttx/sched/sched_waitpid.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nuttx/sched/sched_waitpid.c b/nuttx/sched/sched_waitpid.c index e8e2f61a2..692ef6410 100644 --- a/nuttx/sched/sched_waitpid.c +++ b/nuttx/sched/sched_waitpid.c @@ -178,7 +178,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) { - _TCB *tcb = sched_gettcb(pid); + _TCB *tcb; bool mystat; int err; int ret; @@ -186,6 +186,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) /* Disable pre-emption so that nothing changes in the following tests */ sched_lock(); + tcb = sched_gettcb(pid); if (!tcb) { err = ECHILD; |