Mark3 Realtime Kernel
blocking.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 =========================================================================== */
46 #pragma once
47 
48 #include "kerneltypes.h"
49 #include "mark3cfg.h"
50 
51 #include "ll.h"
52 #include "threadlist.h"
53 
54 namespace Mark3
55 {
56 class Thread;
57 
58 //---------------------------------------------------------------------------
66 {
67 public:
70 
71 protected:
91  void Block(Thread* pclThread_);
92 
100  void BlockPriority(Thread* pclThread_);
101 
112  void UnBlock(Thread* pclThread_);
113 
118 
124 
125  // Cookies used to determine whether or not an object has been initialized
126  static constexpr auto m_uBlockingInvalidCookie = uint8_t { 0x3C };
127  static constexpr auto m_uBlockingInitCookie = uint8_t { 0xC3 };
128 
134 
140 };
141 } // namespace Mark3
Basic data type primatives used throughout the OS.
The ThreadList Class. This class is used for building thread-management facilities, such as schedulers, and blocking objects.
Definition: threadlist.h:38
void UnBlock(Thread *pclThread_)
UnBlock Unblock a thread that is already blocked on this object, returning it to the "ready" state by...
Definition: blocking.cpp:56
void BlockPriority(Thread *pclThread_)
BlockPriority Same as Block(), but ensures that threads are added to the block-list in priority-order...
Definition: blocking.cpp:41
void Block(Thread *pclThread_)
Block Blocks a thread on this object. This is the fundamental operation performed by any sort of bloc...
Definition: blocking.cpp:26
Definition: atomic.cpp:23
Mark3 Kernel Configuration This file is used to configure the kernel for your specific application in...
The Thread Class. This object providing the fundamental thread control data structures and functions ...
Definition: thread.h:64
static constexpr auto m_uBlockingInvalidCookie
Definition: blocking.h:126
bool IsInitialized(void)
IsInitialized.
Definition: blocking.h:123
static constexpr auto m_uBlockingInitCookie
Definition: blocking.h:127
uint8_t m_u8Initialized
Definition: blocking.h:139
ThreadList m_clBlockList
Definition: blocking.h:133
The BlockingObject class. Class implementing thread-blocking primatives. used for implementing things...
Definition: blocking.h:65
void SetInitialized(void)
SetInitialized.
Definition: blocking.h:117
Core linked-list declarations, used by all kernel list types At the heart of RTOS data structures are...
Thread linked-list declarations.