1 #include "Thread_Task.h"
2 #include "ace/OS_NS_unistd.h"
3 #include "../Scheduler.h"
4 #include "tao/RTScheduling/RTScheduler_Manager.h"
5 #include "tao/ORB_Core.h"
8 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
13 CORBA::ORB_init (argc
,
16 CORBA::Object_var manager_obj
= orb
->resolve_initial_references ("RTSchedulerManager");
18 TAO_RTScheduler_Manager_var manager
= TAO_RTScheduler_Manager::_narrow (manager_obj
.in ());
20 TAO_Scheduler
scheduler (orb
.in ());
22 manager
->rtscheduler (&scheduler
);
26 task
.activate_task (orb
.in ());
29 "Waiting for Threads to Activate...\n"));
32 "Threads Activated\n"));
35 "Cancelling Threads.....\n"));
37 CORBA::Object_var current_obj
= orb
->resolve_initial_references ("RTScheduler_Current");
39 RTScheduling::Current_var current
= RTScheduling::Current::_narrow (current_obj
.in ());
41 for (int i
= 0; i
< 4; i
++)
43 RTScheduling::DistributableThread_var DT
= current
->lookup ((task
.guids ())[i
]);
50 ACE_Thread_Manager::instance ()->wait ();
54 catch (const CORBA::Exception
& ex
)
56 ex
._tao_print_exception ("Caught exception:");