Mark3 Realtime Kernel
threadlist.h
Go to the documentation of this file.
1 /*===========================================================================
2  _____ _____ _____ _____
3  ___| _|__ __|_ |__ __|__ |__ __| __ |__ ______
4 | \ / | || \ || | || |/ / ||___ |
5 | \/ | || \ || \ || \ ||___ |
6 |__/\__/|__|_||__|\__\ __||__|\__\ __||__|\__\ __||______|
7  |_____| |_____| |_____| |_____|
8 
9 --[Mark3 Realtime Platform]--------------------------------------------------
10 
11 Copyright (c) 2012 - 2019 m0slevin, all rights reserved.
12 See license.txt for more information
13 =========================================================================== */
22 #pragma once
23 
24 #include "kerneltypes.h"
25 #include "priomap.h"
26 #include "ll.h"
27 
28 //---------------------------------------------------------------------------
29 namespace Mark3
30 {
31 class Thread;
32 
38 class ThreadList : public TypedLinkListNode<ThreadList>, public TypedCircularLinkList<Thread>
39 {
40 public:
41  void* operator new(size_t sz, void* pv) { return reinterpret_cast<ThreadList*>(pv); };
46  ThreadList();
47 
54  void SetPriority(PORT_PRIO_TYPE uXPriority_);
55 
64  void SetMapPointer(PriorityMap* pclMap_);
65 
72  void Add(Thread* node_);
73 
84  void Add(Thread* node_, PriorityMap* pclMap_, PORT_PRIO_TYPE uXPriority_);
85 
93  void AddPriority(Thread* node_);
94 
101  void Remove(Thread* node_);
102 
110 
111 private:
114 
117 };
118 } // namespace Mark3
void SetMapPointer(PriorityMap *pclMap_)
SetMapPointer Set the pointer to a bitmap to use for this threadlist. Once again, only needed when th...
Definition: threadlist.cpp:40
Basic data type primatives used throughout the OS.
PriorityMap * m_pclMap
Pointer to the bitmap/flag to set when used for scheduling.
Definition: threadlist.h:116
The ThreadList Class. This class is used for building thread-management facilities, such as schedulers, and blocking objects.
Definition: threadlist.h:38
PORT_PRIO_TYPE m_uXPriority
Priority of the threadlist.
Definition: threadlist.h:113
#define PORT_PRIO_TYPE
Type used for bitmap in the PriorityMap class.
Definition: portcfg.h:73
void Remove(Thread *node_)
Remove Remove the specified thread from the threadlist.
Definition: threadlist.cpp:111
Definition: atomic.cpp:23
void SetPriority(PORT_PRIO_TYPE uXPriority_)
SetPriority Set the priority of this threadlist (if used for a scheduler).
Definition: threadlist.cpp:34
The Thread Class. This object providing the fundamental thread control data structures and functions ...
Definition: thread.h:64
void AddPriority(Thread *node_)
AddPriority Add a thread to the list such that threads are ordered from highest to lowest priority fr...
Definition: threadlist.cpp:66
Priority map data structure.
The PriorityMapL1 class This class implements a priority bitmap data structure. Each bit in the objec...
Definition: priomapl1.h:45
Thread * HighestWaiter()
HighestWaiter Return a pointer to the highest-priority thread in the thread-list. ...
Definition: threadlist.cpp:128
ThreadList()
ThreadList Default constructor - zero-initializes the data.
Definition: threadlist.cpp:27
void Add(Thread *node_)
Add Add a thread to the threadlist.
Definition: threadlist.cpp:47
Core linked-list declarations, used by all kernel list types At the heart of RTOS data structures are...