distortos  v0.4.0
object-oriented C++ RTOS for microcontrollers
Thread.hpp
Go to the documentation of this file.
1 
12 #ifndef INCLUDE_DISTORTOS_THREAD_HPP_
13 #define INCLUDE_DISTORTOS_THREAD_HPP_
14 
16 
18 #include "distortos/SignalSet.hpp"
20 
21 #include <csignal>
22 
23 namespace distortos
24 {
25 
32 class Thread
33 {
34 public:
35 
40  virtual ~Thread() = 0;
41 
42 #ifdef CONFIG_THREAD_DETACH_ENABLE
43 
58  virtual int detach() = 0;
59 
60 #endif // def CONFIG_THREAD_DETACH_ENABLE
61 
79  virtual int generateSignal(uint8_t signalNumber) = 0;
80 
85  virtual uint8_t getEffectivePriority() const = 0;
86 
99  virtual SignalSet getPendingSignalSet() const = 0;
100 
105  virtual uint8_t getPriority() const = 0;
106 
111  virtual SchedulingPolicy getSchedulingPolicy() const = 0;
112 
117  virtual size_t getStackHighWaterMark() const = 0;
118 
123  virtual size_t getStackSize() const = 0;
124 
129  virtual ThreadState getState() const = 0;
130 
150  virtual int join() = 0;
151 
172  virtual int queueSignal(uint8_t signalNumber, sigval value) = 0;
173 
185  virtual void setPriority(uint8_t priority, bool alwaysBehind = {}) = 0;
186 
191  virtual void setSchedulingPolicy(SchedulingPolicy schedulingPolicy) = 0;
192 };
193 
194 } // namespace distortos
195 
196 #endif // INCLUDE_DISTORTOS_THREAD_HPP_
virtual int detach()=0
Detaches the thread.
Definition: signal.h:28
virtual ThreadState getState() const =0
virtual void setSchedulingPolicy(SchedulingPolicy schedulingPolicy)=0
virtual size_t getStackSize() const =0
SchedulingPolicy
scheduling policy of the thread
Definition: SchedulingPolicy.hpp:26
SignalSet class header.
ThreadState enum class header.
virtual size_t getStackHighWaterMark() const =0
virtual SchedulingPolicy getSchedulingPolicy() const =0
virtual uint8_t getEffectivePriority() const =0
distortos configuration
virtual uint8_t getPriority() const =0
SignalSet class is used as a set of signals.
Definition: SignalSet.hpp:28
Top-level namespace of distortos project.
virtual ~Thread()=0
Thread&#39;s destructor.
Definition: Thread.cpp:21
virtual void setPriority(uint8_t priority, bool alwaysBehind={})=0
Changes priority of thread.
virtual SignalSet getPendingSignalSet() const =0
Gets set of currently pending signals.
virtual int queueSignal(uint8_t signalNumber, sigval value)=0
Queues signal for thread.
virtual int generateSignal(uint8_t signalNumber)=0
Generates signal for thread.
virtual int join()=0
Waits for thread termination.
Thread class is a pure abstract interface for threads.
Definition: Thread.hpp:32
ThreadState
state of the thread
Definition: ThreadState.hpp:26
SchedulingPolicy enum class header.