diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-08-26 22:00:38 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-08-26 22:00:38 +0000 |
commit | 61fccacd853fbdc872deab875012b67fd85240be (patch) | |
tree | 17dd760a6289dcf53853dbd7c05f10533dfbccd1 /nuttx | |
parent | fe493d8bb89c6f052f2cd8a66c00f50fd77ad442 (diff) | |
download | px4-firmware-61fccacd853fbdc872deab875012b67fd85240be.tar.gz px4-firmware-61fccacd853fbdc872deab875012b67fd85240be.tar.bz2 px4-firmware-61fccacd853fbdc872deab875012b67fd85240be.zip |
waitpid(): Move some logic inside of a critical section
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5054 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/ChangeLog | 2 | ||||
-rw-r--r-- | nuttx/sched/sched_waitpid.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 4135bd19a..cb7f4079d 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3183,3 +3183,5 @@ Fix some strange (and probably wrong) list handling when CONFIG_PRIORITY_INHERITANCE and CONFIG_SEM_PREALLOCHOLDERS are defined. This list handling was probably causing errors reported by Mike Smith + * sched/sched_waitpid.c: Fix a possible issue with logic logic that + should be brought into a critical section (suggested by Mike Smith) 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; |