summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-08-28 14:40:12 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-08-28 14:40:12 +0000
commita9ead1328ee2c67363e580946564c80ed91d96ff (patch)
tree649fb785890c05db65ac6d00418aad80205e729e /apps
parent814f5dab600d19ffe043363814503c113549e221 (diff)
downloadnuttx-a9ead1328ee2c67363e580946564c80ed91d96ff.tar.gz
nuttx-a9ead1328ee2c67363e580946564c80ed91d96ff.tar.bz2
nuttx-a9ead1328ee2c67363e580946564c80ed91d96ff.zip
Add some protection to the priority inheritance logic when sem_post() is called from an interrupt handler
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5060 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps')
-rwxr-xr-xapps/ChangeLog.txt5
-rw-r--r--apps/examples/ostest/prioinherit.c12
2 files changed, 15 insertions, 2 deletions
diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt
index 0f60338a4..361fb97dc 100755
--- a/apps/ChangeLog.txt
+++ b/apps/ChangeLog.txt
@@ -285,4 +285,9 @@
list (contributed by Kate).
* apps/nshlib/nsh_parse.c: CONFIG_NSH_DISABLE_WGET not CONFIG_NSH_DISABLE_GET
in one location (found by Kate).
+ * apps/examples/ostest/prioinherit.c: Limit the number of test
+ threds to no more than 3 of each priority. Bad things happen
+ when the existing logic tried to created several hundred test
+ treads!
+
diff --git a/apps/examples/ostest/prioinherit.c b/apps/examples/ostest/prioinherit.c
index 87849abcf..eea5a818f 100644
--- a/apps/examples/ostest/prioinherit.c
+++ b/apps/examples/ostest/prioinherit.c
@@ -59,20 +59,28 @@
# define CONFIG_SEM_PREALLOCHOLDERS 0
#endif
+/* If resources were configured for lots of holders, then run 3 low priority
+ * threads. Otherwise, just one.
+ */
+
#if CONFIG_SEM_PREALLOCHOLDERS > 3
# define NLOWPRI_THREADS 3
#else
-# define NLOWPRI_THREADS (CONFIG_SEM_PREALLOCHOLDERS+1)
+# define NLOWPRI_THREADS 1
#endif
#ifndef CONFIG_SEM_NNESTPRIO
# define CONFIG_SEM_NNESTPRIO 0
#endif
+/* Where resources configured for lots of waiters? If so then run 3 high
+ * priority threads. Otherwise, just one.
+ */
+
#if CONFIG_SEM_NNESTPRIO > 3
# define NHIGHPRI_THREADS 3
#else
-# define NHIGHPRI_THREADS (CONFIG_SEM_NNESTPRIO+1)
+# define NHIGHPRI_THREADS 1
#endif
/****************************************************************************