43 #include "../Time.hpp" 44 #include "../Logger.hpp" 46 #include "../os/MutexLock.hpp" 47 #include "../os/MainThread.hpp" 50 using namespace extras;
64 return Instance(scheduler, pri, per, 0);
73 TimerThreadList::iterator it = TimerThreads.begin();
74 while ( it != TimerThreads.end() ) {
78 TimerThreads.erase(it);
79 it = TimerThreads.begin();
82 if ( tptr->getScheduler() == scheduler &&
83 tptr->getPriority() == pri &&
85 tptr->getCpuAffinity() == cpu_affinity ) {
91 TimerThreads.push_back( ret );
102 :
Thread(scheduler, priority, periodicity, cpu_affinity, name), cleanup(false)
119 tasks.push_back( t );
126 ActivityList::iterator it = find(tasks.begin(), tasks.end(), t);
127 if ( it != tasks.end() ) {
143 for( ActivityList::iterator t_iter = tasks.begin(); t_iter != tasks.end(); ++t_iter)
155 for( ActivityList::iterator t_iter = tasks.begin(); t_iter != tasks.end(); ++t_iter)
165 ActivityList::iterator begin = tasks.begin();
168 ActivityList::iterator it = tasks.begin();
170 it = find( tasks.begin(), tasks.end(), nullActivity);
172 while ( it != tasks.end() ) {
174 while ( begin != tasks.end() && *begin == 0 )
176 if ( begin == tasks.end() ) {
178 tasks.resize( it - tasks.begin() );
183 ActivityList::iterator end = find ( begin, tasks.end(), nullActivity);
186 while ( begin != end ) {
static ThreadInterface * Instance()
Return an object which represents the main thread.
A Thread object executes user code in its own thread.
bool CheckPriority(int &sched_type, int &priority)
Check if the scheduler type and priority match and adapt to a valid value.
virtual unsigned getCpuAffinity() const =0
nsecs Seconds_to_nsecs(const Seconds s)
virtual bool stop()
Stop the Thread.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
MutexLock is a scope based Monitor, protecting critical sections with a Mutex object through locking ...