From eb054a0ea1003fa8875e9ca25e82a6311887dcfe Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Tue, 21 Mar 2017 08:18:19 -1000 Subject: [PATCH] priority_restoration_fix:Review feedback Additional backport of c2c226be1db53dd0c1315e13bbd76ace6538eedf sem_holder:Clean up from Review --- nuttx-patches/priority_restoration_fix.patch | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nuttx-patches/priority_restoration_fix.patch b/nuttx-patches/priority_restoration_fix.patch index ce7105963f..d028394dcd 100644 --- a/nuttx-patches/priority_restoration_fix.patch +++ b/nuttx-patches/priority_restoration_fix.patch @@ -60,7 +60,7 @@ index f4037d3..ec7de27 100644 #endif return OK; diff --git NuttX/nuttx/sched/semaphore/sem_holder.c NuttX/nuttx/sched/semaphore/sem_holder.c -index 6b9f05a..bc5c186 100644 +index 6b9f05a..7b4e3e3 100644 --- NuttX/nuttx/sched/semaphore/sem_holder.c +++ NuttX/nuttx/sched/semaphore/sem_holder.c @@ -93,7 +93,7 @@ static inline FAR struct semholder_s *sem_allocholder(sem_t *sem) @@ -126,7 +126,7 @@ index 6b9f05a..bc5c186 100644 + int i; + pholder = NULL; + -+ /* We have two hard-allocated holder structuse in sem_t */ ++ /* We have two hard-allocated holder structures in sem_t */ + + for (i = 0; i < 2; i++) { @@ -243,7 +243,7 @@ index 6b9f05a..bc5c186 100644 if (!sched_verifytcb(htcb)) { serr("ERROR: TCB 0x%08x is a stale handle, counts lost\n", htcb); -+ DEBUGASSERT(!sched_verifytcb(htcb)); ++ DEBUGASSERT(sched_verifytcb(htcb)); sem_freeholder(sem, pholder); } @@ -297,7 +297,7 @@ index 6b9f05a..bc5c186 100644 { serr("ERROR: TCB 0x%08x is a stale handle, counts lost\n", htcb); - sem_freeholder(sem, pholder); -+ DEBUGASSERT(!sched_verifytcb(htcb)); ++ DEBUGASSERT(sched_verifytcb(htcb)); + pholder = sem_findholder(sem, htcb); + if (pholder != NULL) + { @@ -411,14 +411,14 @@ index 6b9f05a..bc5c186 100644 + if (sem->hhead != NULL) { serr("ERROR: Semaphore destroyed with holders\n"); -+ DEBUGASSERT(sem->hhead != NULL); ++ DEBUGASSERT(sem->hhead == NULL); (void)sem_foreachholder(sem, sem_recoverholders, NULL); } #else - if (sem->holder.htcb) -+ if (sem->holder[0].htcb != NULL || sem->holder[0].htcb != NULL) ++ if (sem->holder[0].htcb != NULL || sem->holder[1].htcb != NULL) { -+ DEBUGASSERT(sem->holder[0].htcb != NULL || sem->holder[0].htcb != NULL); ++ DEBUGASSERT(sem->holder[0].htcb == NULL || sem->holder[1].htcb == NULL); serr("ERROR: Semaphore destroyed with holder\n"); }