diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-02-24 02:49:41 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-02-24 02:49:41 +0000 |
commit | b3fceba2119cfee8c96d653a0fd2fd974b215268 (patch) | |
tree | 5072f7ced0ec736daf3d0e281708db7f5fcd8b14 /TAO/orbsvcs/examples | |
parent | df6480e20e8d78a2a1554cdbcc0b68666dc0eb1c (diff) | |
download | ATCD-b3fceba2119cfee8c96d653a0fd2fd974b215268.tar.gz |
ChangeLogTag:Wed Feb 23 18:35:41 2000 Carlos O'Ryan <coryan@uci.edu>
Diffstat (limited to 'TAO/orbsvcs/examples')
-rw-r--r-- | TAO/orbsvcs/examples/RtEC/Schedule/Service.cpp | 13 | ||||
-rw-r--r-- | TAO/orbsvcs/examples/RtEC/Simple/Service.cpp | 34 |
2 files changed, 26 insertions, 21 deletions
diff --git a/TAO/orbsvcs/examples/RtEC/Schedule/Service.cpp b/TAO/orbsvcs/examples/RtEC/Schedule/Service.cpp index 839ebaccdad..8341839c1e9 100644 --- a/TAO/orbsvcs/examples/RtEC/Schedule/Service.cpp +++ b/TAO/orbsvcs/examples/RtEC/Schedule/Service.cpp @@ -15,6 +15,7 @@ #include "ace/Get_Opt.h" #include "ace/Sched_Params.h" +#include "ace/Auto_Ptr.h" ACE_RCSID(EC_Examples, Service, "$Id$") @@ -227,8 +228,10 @@ main (int argc, char* argv[]) // lie to the scheduler to obtain right priorities; but we // don't care if the set is schedulable. tv.set (0, 10000); - TimeBase::TimeT rate; - ORBSVCS_Time::Time_Value_to_TimeT (rate, tv); + TimeBase::TimeT tmp; + ORBSVCS_Time::Time_Value_to_TimeT (tmp, tv); + RtecScheduler::Period_t rate = ACE_U64_TO_U32(tmp); + scheduler->set (supplier_rt_info1, RtecScheduler::VERY_HIGH_CRITICALITY, 0, 0, 0, @@ -249,7 +252,9 @@ main (int argc, char* argv[]) // lie to the scheduler to obtain right priorities; but we // don't care if the set is schedulable. tv.set (0, 20000); - ORBSVCS_Time::Time_Value_to_TimeT (rate, tv); + ORBSVCS_Time::Time_Value_to_TimeT (tmp, tv); + rate = ACE_U64_TO_U32(tmp); + scheduler->set (supplier_rt_info2, RtecScheduler::VERY_HIGH_CRITICALITY, 0, 0, 0, @@ -399,7 +404,7 @@ int parse_args (int argc, char *argv[]) default: ACE_ERROR_RETURN ((LM_ERROR, "usage: %s " - "-c (config run)" + "-c (config run)" "\n", argv [0]), -1); diff --git a/TAO/orbsvcs/examples/RtEC/Simple/Service.cpp b/TAO/orbsvcs/examples/RtEC/Simple/Service.cpp index 82d7280c387..5df20ad8a45 100644 --- a/TAO/orbsvcs/examples/RtEC/Simple/Service.cpp +++ b/TAO/orbsvcs/examples/RtEC/Simple/Service.cpp @@ -44,7 +44,7 @@ main (int argc, char* argv[]) TAO_EC_Event_Channel_Attributes attributes (poa.in (), poa.in ()); - + TAO_EC_Event_Channel ec_impl (attributes); ec_impl.activate (ACE_TRY_ENV); ACE_TRY_CHECK; @@ -54,25 +54,25 @@ main (int argc, char* argv[]) ACE_TRY_CHECK; CORBA::String_var ior = - orb->object_to_string (event_channel.in (), ACE_TRY_ENV); + orb->object_to_string (event_channel.in (), ACE_TRY_ENV); ACE_TRY_CHECK; ACE_DEBUG ((LM_DEBUG, "Activated as <%s>\n", ior.in ())); // If the ior_output_file exists, output the ior to it if (ior_output_file != 0) - { - FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: %s", - ior_output_file), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - } - - // Wait for events, using work_pending()/perform_work() may help + { + FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); + if (output_file == 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot open output file for writing IOR: %s", + ior_output_file), + 1); + ACE_OS::fprintf (output_file, "%s", ior.in ()); + ACE_OS::fclose (output_file); + } + + // Wait for events, using work_pending()/perform_work() may help // or using another thread, this example is too simple for that. orb->run (); @@ -103,14 +103,14 @@ int parse_args (int argc, char *argv[]) switch (c) { case 'o': - ior_output_file = get_opts.optarg; - break; + ior_output_file = get_opts.optarg; + break; case '?': default: ACE_ERROR_RETURN ((LM_ERROR, "usage: %s " - "-o <iorfile>" + "-o <iorfile>" "\n", argv [0]), -1); |