distortos  v0.4.0
object-oriented C++ RTOS for microcontrollers
ThreadListNode.hpp
Go to the documentation of this file.
1 
12 #ifndef INCLUDE_DISTORTOS_INTERNAL_SCHEDULER_THREADLISTNODE_HPP_
13 #define INCLUDE_DISTORTOS_INTERNAL_SCHEDULER_THREADLISTNODE_HPP_
14 
15 #include "estd/IntrusiveList.hpp"
16 
17 namespace distortos
18 {
19 
20 namespace internal
21 {
22 
31 {
32 public:
33 
40  constexpr ThreadListNode(const uint8_t priority) :
43  priority_{priority},
45  {
46 
47  }
48 
53  uint8_t getEffectivePriority() const
54  {
55  return std::max(priority_, boostedPriority_);
56  }
57 
62  uint8_t getPriority() const
63  {
64  return priority_;
65  }
66 
69 
72 
73 protected:
74 
76  uint8_t priority_;
77 
80 };
81 
82 } // namespace internal
83 
84 } // namespace distortos
85 
86 #endif // INCLUDE_DISTORTOS_INTERNAL_SCHEDULER_THREADLISTNODE_HPP_
uint8_t getPriority() const
Definition: ThreadListNode.hpp:62
constexpr ThreadListNode(const uint8_t priority)
ThreadListNode's constructor.
Definition: ThreadListNode.hpp:40
uint8_t getEffectivePriority() const
Definition: ThreadListNode.hpp:53
uint8_t priority_
thread's priority, 0 - lowest, UINT8_MAX - highest
Definition: ThreadListNode.hpp:76
IntrusiveListNode class is the node that is needed for the object to be linked in IntrusiveList...
Definition: IntrusiveList.hpp:38
estd::IntrusiveListNode threadListNode
node for intrusive list in thread lists
Definition: ThreadListNode.hpp:68
Top-level namespace of distortos project.
estd::IntrusiveListNode threadGroupNode
node for intrusive list in thread group
Definition: ThreadListNode.hpp:71
ThreadListNode class is a base for ThreadControlBlock that provides nodes for intrusive lists...
Definition: ThreadListNode.hpp:30
uint8_t boostedPriority_
thread's boosted priority, 0 - no boosting
Definition: ThreadListNode.hpp:79
IntrusiveList template class header.