Thread IDs
include/thread/tid.h View source View on GitHubStructs
Section titled “Structs”tid_range
Section titled “tid_range”struct tid_range {
struct rbt_node node;
uint64_t start;
uint64_t length;
struct tid_range *next;
}; tid_space
Section titled “tid_space”struct tid_space {
struct rbt tree;
struct spinlock lock;
struct tid_range reserve_pool[TID_RANGE_RESERVE_COUNT];
struct tid_range *reserve_free;
}; Functions
Section titled “Functions”tid_alloc
Section titled “tid_alloc”uint64_t tid_alloc(struct tid_space *ts); tid_free
Section titled “tid_free”void tid_free(struct tid_space *ts, uint64_t id); tid_space_init
Section titled “tid_space_init”struct tid_space * tid_space_init(uint64_t max_id); Macros
Section titled “Macros”TID_RANGE_RESERVE_COUNT
Section titled “TID_RANGE_RESERVE_COUNT”#define TID_RANGE_RESERVE_COUNT 128