diff packages/kernel/current/tests/mutex3.cxx @ 178:aa8364213009

Merge from eCos master repository on 2001-08-15-01:50:29-BST
author jlarmour
date Wed, 15 Aug 2001 02:21:28 +0000
parents 4c750ce71ae3
children 678094f34118
line wrap: on
line diff
--- a/packages/kernel/current/tests/mutex3.cxx
+++ b/packages/kernel/current/tests/mutex3.cxx
@@ -79,15 +79,39 @@ cyg_hal_invoke_constructors();
 #ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INVERSION_PROTOCOL_INHERIT
 # ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INVERSION_PROTOCOL_DYNAMIC
 #  ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INVERSION_PROTOCOL_DEFAULT_INHERIT
-#   define PRIORITY_INHERITANCE
-#  else
-#   undef PRIORITY_INHERITANCE
+#   define PRIORITY_INHERITANCE "dynamic-default-inherit"
 #  endif
 # else
-#  define PRIORITY_INHERITANCE
+#  define PRIORITY_INHERITANCE "static-inherit"
 # endif
-#else
-# undef PRIORITY_INHERITANCE
+#endif
+
+#ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INVERSION_PROTOCOL_CEILING
+# ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INVERSION_PROTOCOL_DYNAMIC
+#  ifdef CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INVERSION_PROTOCOL_DEFAULT_CEILING
+#   if CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INVERSION_PROTOCOL_DEFAULT_PRIORITY <= 5
+#    define PRIORITY_INHERITANCE "dynamic-default-ceiling-high"
+#   elif CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INVERSION_PROTOCOL_DEFAULT_PRIORITY >= 15
+#    define NO_PRIORITY_INHERITANCE "dynamic-default-ceiling-low"
+#   else
+#    define PRIORITY_UNKNOWN "dynamic-default-ceiling-mid"
+#   endif
+#  endif
+# else
+#  if CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INVERSION_PROTOCOL_DEFAULT_PRIORITY <= 5
+#   define PRIORITY_INHERITANCE "static-ceiling-high"
+#  elif CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INVERSION_PROTOCOL_DEFAULT_PRIORITY >= 15
+#   define NO_PRIORITY_INHERITANCE "static-ceiling-low"
+#  else
+#   define PRIORITY_UNKNOWN "static-ceiling-mid"
+#  endif
+# endif
+#endif
+
+#ifndef PRIORITY_INHERITANCE
+# ifndef NO_PRIORITY_INHERITANCE
+#  define NO_PRIORITY_INHERITANCE "no scheme selected"
+# endif
 #endif
 
 // ------------------------------------------------------------------------
@@ -280,15 +304,19 @@ static void t2( CYG_ADDRWORD data )
         // Wait longer than the delay in t3 waiting on go_flag
     } while ( now < (then + 3) );
 
+#ifdef PRIORITY_UNKNOWN
+    CYG_TEST_INFO( "Not checking: " PRIORITY_UNKNOWN );
+#else
 #ifdef PRIORITY_INHERITANCE
-    CYG_TEST_INFO( "Checking for mutex priority inheritance" );
+    CYG_TEST_INFO( "Checking priority scheme: " PRIORITY_INHERITANCE );
     CYG_TEST_CHECK( 1 == t3ran, "Thread 3 did not run" );
     CYG_TEST_CHECK( 1 == got_it, "Thread 1 did not get the mutex" );
 #else
-    CYG_TEST_INFO( "Checking for NO mutex priority inheritance" );
+    CYG_TEST_INFO( "Checking NO priority scheme: " NO_PRIORITY_INHERITANCE );
     CYG_TEST_CHECK( 0 == t3ran, "Thread 3 DID run" );
     CYG_TEST_CHECK( 0 == got_it, "Thread 1 DID get the mutex" );
 #endif
+#endif
 
     CYG_TEST_CHECK( 0 == t3ended, "Thread 3 ended prematurely [T2,1]" );