Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / orbsvcs / performance-tests / RTEvent / lib / Task_Activator.cpp
blob5a0d22ea8d2bdc3e8123e81b00ae1d7d800ce216
1 /**
2 * @file Task_Activator.cpp
4 * @author Jody Hagins <jody@atdesk.com>
5 * @author Carlos O'Ryan <coryan@uci.edu>
6 */
7 #ifndef TAO_PERF_RTEC_TASK_ACTIVATOR_CPP
8 #define TAO_PERF_RTEC_TASK_ACTIVATOR_CPP
10 #include "Task_Activator.h"
11 #include "tao/Environment.h"
12 #include "ace/Log_Msg.h"
14 #if !defined(__ACE_INLINE__)
15 #include "Task_Activator.inl"
16 #endif /* __ACE_INLINE__ */
18 template<class Task>
19 Task_Activator<Task>::Task_Activator (int priority,
20 int scheduling_class,
21 int nthreads,
22 Task *task)
23 : task_ (task)
25 if (this->task_ == 0)
26 return;
28 // We explicitly ignore errors, this is exactly what we do in the
29 // test anyway. In a generic class we would need to throw an
30 // exception.
31 if (this->task_->activate (scheduling_class | THR_NEW_LWP | THR_JOINABLE,
32 nthreads,
33 1, // force_activation
34 priority) == -1)
36 // Release, we cannot wait for it or anything like that...
37 this->task_ = 0;
38 ACE_DEBUG ((LM_DEBUG,
39 "Task_Activator failed %p\n", ""));
43 template<class Task>
44 Task_Activator<Task>::~Task_Activator ()
46 if (this->task_ == 0)
47 return;
49 // Wait until the task terminates
50 this->task_->wait ();
53 #endif /* TAO_PERF_RTEC_TASK_ACTIVATOR_CPP */