38 #ifndef ORO_THREAD_HPP 39 #define ORO_THREAD_HPP 42 #include "../rtt-config.h" 126 Thread(
int scheduler,
int priority,
double period,
unsigned cpu_affinity,
127 const std::string & name);
138 static void setStackSize(
unsigned int ssize);
145 static void setLockTimeoutNoPeriod(
double timeout_in_s);
153 static void setLockTimeoutPeriodFactor(
double factor);
156 virtual bool start();
164 void setStopTimeout(
Seconds s);
172 Seconds getStopTimeout()
const;
191 void getPeriod(
secs& s,
nsecs& ns)
const;
193 virtual Seconds getPeriod()
const;
195 virtual nsecs getPeriodNS()
const;
197 virtual bool isPeriodic()
const;
199 virtual bool isRunning()
const;
201 virtual bool isActive()
const;
203 virtual const char* getName()
const;
215 virtual bool setScheduler(
int sched_type);
217 virtual int getScheduler()
const;
219 virtual bool setPriority(
int priority);
221 virtual int getPriority()
const;
223 virtual unsigned int getPid()
const;
230 virtual bool setCpuAffinity(
unsigned cpu_affinity);
235 virtual unsigned getCpuAffinity()
const;
237 virtual void yield();
239 virtual void setMaxOverrun(
int m);
241 virtual int getMaxOverrun()
const;
243 virtual void setWaitPeriodPolicy(
int p);
253 void emergencyStop();
268 virtual bool breakLoop();
273 virtual bool initialize();
278 virtual void finalize();
282 void setup(
int _priority,
unsigned cpu_affinity,
const std::string& name);
359 #ifdef OROPKG_OS_THREAD_SCOPE
rt_sem_t sem
The semaphore used for starting the thread.
static unsigned int default_stack_size
double Seconds
Seconds are stored as a double precision float.
A Thread object executes user code in its own thread.
bool inloop
Is true when in the loop (isRunning() )
MutexRecursive breaker
Used to implement synchronising breakLoop().
long secs
seconds as a signed long.
void * thread_function(void *t)
bool prepareForExit
Signal the thread that it should exit.
virtual RTOS_TASK * getTask()
Get the RTOS_TASK pointer.
bool running
Indicates if step() or loop() should be executed.
static double lock_timeout_period_factor
configuration of the lock timeout for periodic tasks in seconds
A thread which is being run.
virtual const RTOS_TASK * getTask() const
const version of the above.
int msched_type
Desired scheduler type.
int maxOverRun
The maximum times a periodic overrun may happen, or -1 if unlimited.
static double lock_timeout_no_period_in_s
configuration of the lock timeout in seconds
bool active
When set to 1, the thread will run, when set to 0 the thread will stop ( isActive() ) ...
RTOS_TASK rtos_task
The realtime task structure created by this object.
NANO_TIME period
The period as it is passed to the operating system.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
An object oriented wrapper around a recursive mutex.
long long nsecs
nanoseconds as a signed long long.
A class representing a Digital Output device which can read or write a maximum of 32 bits at once...
struct timespec TIME_SPEC
double stopTimeout
The timeout, in seconds, for stop()