[rtems commit] smptests: Use priority ceiling for locked print

Sebastian Huber sebh at rtems.org
Fri May 31 13:15:45 UTC 2013


Module:    rtems
Branch:    master
Commit:    ac2bb464a5948ff0b3ae4bb5bd4434735e6c0e04
Changeset: http://git.rtems.org/rtems/commit/?id=ac2bb464a5948ff0b3ae4bb5bd4434735e6c0e04

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri May 31 13:56:56 2013 +0200

smptests: Use priority ceiling for locked print

In case the printf() blocks on a semaphore it was possible to end up in
a livelock.

---

 testsuites/smptests/smp08/init.c      |    2 +-
 testsuites/support/src/locked_print.c |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/testsuites/smptests/smp08/init.c b/testsuites/smptests/smp08/init.c
index 1c03cec..8e8de7c 100644
--- a/testsuites/smptests/smp08/init.c
+++ b/testsuites/smptests/smp08/init.c
@@ -78,7 +78,7 @@ rtems_task Init(
     sprintf(ch, "%02" PRId32, i );
     status = rtems_task_create(
       rtems_build_name( 'T', 'A', ch[0], ch[1] ),
-      1,
+      2,
       RTEMS_MINIMUM_STACK_SIZE,
       RTEMS_DEFAULT_MODES,
       RTEMS_DEFAULT_ATTRIBUTES,
diff --git a/testsuites/support/src/locked_print.c b/testsuites/support/src/locked_print.c
index 62e72bf..8a901c9 100644
--- a/testsuites/support/src/locked_print.c
+++ b/testsuites/support/src/locked_print.c
@@ -36,7 +36,8 @@ void locked_print_initialize(void)
     rtems_build_name ('S', 'E', 'M', '1'),
     1,                                             
     RTEMS_LOCAL                   |
-    RTEMS_SIMPLE_BINARY_SEMAPHORE |
+    RTEMS_BINARY_SEMAPHORE |
+    RTEMS_PRIORITY_CEILING |
     RTEMS_PRIORITY,
     1,
     &locked_print_semaphore




More information about the vc mailing list