From 99b944fb6e09d7d102b8f7904b626e29ee2f2101 Mon Sep 17 00:00:00 2001 From: Masayuki Ishikawa Date: Fri, 19 Jan 2018 22:11:09 +0900 Subject: [PATCH] sched/semaphore: Add ASSERT(false) in nxsem_post() if no waiting task is found. Signed-off-by: Masayuki Ishikawa --- sched/semaphore/sem_post.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sched/semaphore/sem_post.c b/sched/semaphore/sem_post.c index 08a399b9166..a550c0aab4d 100644 --- a/sched/semaphore/sem_post.c +++ b/sched/semaphore/sem_post.c @@ -165,6 +165,12 @@ int nxsem_post(FAR sem_t *sem) up_unblock_task(stcb); } + else + { + /* This should not happen. */ + + ASSERT(false); + } } /* Check if we need to drop the priority of any threads holding