SimpleKernel 1.17.0
Loading...
Searching...
No Matches
resource_id.hpp File Reference
#include <etl/hash.h>
#include <cstdint>
#include <functional>
Include dependency graph for resource_id.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ResourceId
 资源 ID More...
 
struct  std::hash< ResourceId >
 
struct  etl::hash< ResourceId >
 

Namespaces

namespace  std
 
namespace  etl
 

Enumerations

enum class  ResourceType : uint8_t {
  kNone = 0x00 , kMutex = 0x01 , kSemaphore = 0x02 , kCondVar = 0x03 ,
  kChildExit = 0x04 , kIoComplete = 0x05 , kFutex = 0x06 , kSignal = 0x07 ,
  kTimer = 0x08 , kInterrupt = 0x09 , kResourceTypeCount
}
 资源类型枚举 More...
 

Functions

constexpr auto GetResourceTypeName (ResourceType type) -> const char *
 获取资源类型的字符串表示(用于调试)
 

Enumeration Type Documentation

◆ ResourceType

enum class ResourceType : uint8_t
strong

资源类型枚举

Enumerator
kNone 

无效资源

kMutex 

互斥锁

kSemaphore 

信号量

kCondVar 

条件变量

kChildExit 

等待子进程退出

kIoComplete 

IO 完成

kFutex 

Futex (快速用户空间互斥锁)

kSignal 

信号

kTimer 

定时器

kInterrupt 

中断(用于中断线程化)

kResourceTypeCount 

Definition at line 15 of file resource_id.hpp.

15 : uint8_t {
17 kNone = 0x00,
19 kMutex = 0x01,
21 kSemaphore = 0x02,
23 kCondVar = 0x03,
25 kChildExit = 0x04,
27 kIoComplete = 0x05,
29 kFutex = 0x06,
31 kSignal = 0x07,
33 kTimer = 0x08,
35 kInterrupt = 0x09,
36 // 可以继续扩展...
38};
@ kFutex
Futex (快速用户空间互斥锁)
@ kNone
无效资源
@ kInterrupt
中断(用于中断线程化)
@ kSignal
信号
@ kCondVar
条件变量
@ kChildExit
等待子进程退出
@ kSemaphore
信号量
@ kMutex
互斥锁
@ kTimer
定时器
@ kIoComplete
IO 完成

Function Documentation

◆ GetResourceTypeName()

constexpr auto GetResourceTypeName ( ResourceType  type) -> const char*
constexpr

获取资源类型的字符串表示(用于调试)

Parameters
type资源类型
Returns
类型名称字符串

Definition at line 45 of file resource_id.hpp.

46 {
47 switch (type) {
49 return "None";
51 return "Mutex";
53 return "Semaphore";
55 return "CondVar";
57 return "ChildExit";
59 return "IoComplete";
61 return "Futex";
63 return "Signal";
65 return "Timer";
66 default:
67 return "Unknown";
68 }
69}
Here is the caller graph for this function: