blob: ffcf6dbf8a34b9df7816d6ca2a7ba681c480e365 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
// $Id$
#include "Thread_Task.h"
#include "../Scheduler.h"
#include "tao/RTScheduling/RTScheduler_Manager.h"
int
main (int argc, char* argv [])
{
ACE_TRY_NEW_ENV
{
CORBA::ORB_var orb =
CORBA::ORB_init (argc,
argv,
""
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
CORBA::Object_var manager_obj = orb->resolve_initial_references ("RTSchedulerManager"
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
TAO_RTScheduler_Manager_var manager = TAO_RTScheduler_Manager::_narrow (manager_obj.in ()
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
TAO_Scheduler scheduler (orb.in ());
manager->rtscheduler (&scheduler);
Thread_Task task (orb.in ());
task.activate_task (4);
orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
// Wait until all threads are ready.
ACE_Thread_Manager::instance ()->wait ();
orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
}
ACE_CATCHANY
{
ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
"Caught exception:");
return 1;
}
ACE_ENDTRY;
return 0;
}
|