diff options
Diffstat (limited to 'TAO/performance-tests/Cubit/TAO/MT_Cubit/Globals.cpp')
-rw-r--r-- | TAO/performance-tests/Cubit/TAO/MT_Cubit/Globals.cpp | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Globals.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Globals.cpp index 714f7ac2bc9..1c79674ea33 100644 --- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Globals.cpp +++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Globals.cpp @@ -3,9 +3,7 @@ #include "Globals.h" Globals::Globals (void) - : thr_create_flags (0), - default_priority (0), - ior_file (0), + : ior_file (0), base_port (0), num_of_objs (2), thread_per_rate (0), @@ -78,21 +76,16 @@ Globals::parse_args (int argc, char *argv[]) int Globals::sched_fifo_init (void) { + int result; #if defined (ACE_HAS_THREADS) // Enable FIFO scheduling, e.g., RT scheduling class on Solaris. - if (ACE_OS::sched_params (ACE_Sched_Params (ACE_SCHED_FIFO, - SCHED_PRIORITY, - ACE_SCOPE_PROCESS))) + result = SCHED_PARAMS_FIFO; + if (result != 0) { if (ACE_OS::last_error () == EPERM) - { - ACE_DEBUG ((LM_MAX, - "User is not superuser, " - "so remain in time-sharing class\n")); - ACE_SET_BITS (GLOBALS::instance ()->thr_create_flags, THR_NEW_LWP); - GLOBALS::instance ()->default_priority = ACE_THR_PRI_OTHER_DEF; - return 1; - } + ACE_DEBUG ((LM_MAX, + "preempt: user is not superuser, " + "so remain in time-sharing class\n")); else ACE_ERROR_RETURN ((LM_ERROR, "%n: ACE_OS::sched_params failed\n%a"), @@ -103,11 +96,6 @@ Globals::sched_fifo_init (void) "Test will not run. This platform doesn't seem to have threads.\n"), -1); #endif /* ACE_HAS_THREADS */ - - ACE_SET_BITS (GLOBALS::instance ()->thr_create_flags, THR_BOUND); - ACE_SET_BITS (GLOBALS::instance ()->thr_create_flags, THR_SCHED_FIFO); - GLOBALS::instance ()->default_priority = ACE_THR_PRI_FIFO_DEF; - return 0; } @@ -123,13 +111,13 @@ MT_Priority::get_high_priority (void) ACE_Sched_Priority high_priority; #if defined (VXWORKS) - high_priority = GLOBALS::instance ()->default_priority; + high_priority = ACE_THR_PRI_FIFO_DEF; #elif defined (ACE_WIN32) high_priority = ACE_Sched_Params::priority_max (ACE_SCHED_FIFO, ACE_SCOPE_THREAD); #else - high_priority = GLOBALS::instance ()->default_priority; + high_priority = ACE_THR_PRI_FIFO_DEF + PRIORITY_INCR; #endif /* VXWORKS */ return high_priority; } |