diff options
-rw-r--r-- | nuttx/ChangeLog | 2 | ||||
-rw-r--r-- | nuttx/libc/stdio/Make.defs | 2 | ||||
-rw-r--r-- | nuttx/libc/stdio/lib_vdprintf.c | 2 | ||||
-rw-r--r-- | nuttx/sched/sem_holder.c | 17 |
4 files changed, 18 insertions, 5 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 1906b3c12..2394f68d0 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -4868,3 +4868,5 @@ the SAM4L (2013-6-2). * libc/stdio/lib_dprintd.c and lib_vdprintf.c: Add dprintf() and vdprintf() (the latter from Andrew Tridgell, 2013-6-2). + * sched/sem_holder.c: Modify assertion that is reported to cause + false alarm assertions (2013-6-2). diff --git a/nuttx/libc/stdio/Make.defs b/nuttx/libc/stdio/Make.defs index b64d2bd5b..f04dfb215 100644 --- a/nuttx/libc/stdio/Make.defs +++ b/nuttx/libc/stdio/Make.defs @@ -37,7 +37,7 @@ # This first group of C files do not depend on having file descriptors or # C streams. -CSRCS += lib_fileno.c lib_printf.c lib_syslog.c lib_lowsyslog.c\ +CSRCS += lib_fileno.c lib_printf.c lib_syslog.c lib_lowsyslog.c \ lib_sprintf.c lib_asprintf.c lib_snprintf.c lib_libsprintf.c \ lib_vsprintf.c lib_avsprintf.c lib_vsnprintf.c lib_libvsprintf.c \ lib_dprintf.c lib_vdprintf.c \ diff --git a/nuttx/libc/stdio/lib_vdprintf.c b/nuttx/libc/stdio/lib_vdprintf.c index 8cdea96c6..d96ca40f8 100644 --- a/nuttx/libc/stdio/lib_vdprintf.c +++ b/nuttx/libc/stdio/lib_vdprintf.c @@ -56,4 +56,4 @@ int vdprintf(int fd, FAR const char *fmt, va_list ap) lib_rawoutstream(&rawoutstream, fd); return lib_vsprintf(&rawoutstream.public, fmt, ap); -} +} diff --git a/nuttx/sched/sem_holder.c b/nuttx/sched/sem_holder.c index ab59ec8c8..b88bebf36 100644 --- a/nuttx/sched/sem_holder.c +++ b/nuttx/sched/sem_holder.c @@ -448,11 +448,22 @@ static int sem_restoreholderprio(FAR struct semholder_s *pholder, FAR sem_t *sem if (htcb->npend_reprio < 1) { - /* No... the holder thread has only been boosted once. Reset all - * priorities back to the base priority. + /* No... the holder thread has only been boosted once. + * npend_reprio should be 0 and the boosted priority should be the + * priority of the task that just got the semaphore + * (stcb->sched_priority) + * + * That latter assumption may not be true if the stcb's priority + * was also boosted so that it no longer matches the htcb's + * sched_priority. Or if CONFIG_SEM_NNESTPRIO is too small (so + * that we do not have a proper record of the reprioritizations). */ - DEBUGASSERT(htcb->sched_priority == stcb->sched_priority && htcb->npend_reprio == 0); + DEBUGASSERT(/* htcb->sched_priority == stcb->sched_priority && */ + htcb->npend_reprio == 0); + + /* Reset the holder's priority back to the base priority. */ + sched_reprioritize(htcb, htcb->base_priority); } |