| 1 | /* @title: Thread IDs */ |
|---|---|
| 2 | #pragma once |
| 3 | #include <stdint.h> |
| 4 | #include <structures/id_space.h> |
| 5 | |
| 6 | #define TID_RANGE_RESERVE_COUNT ID_RANGE_RESERVE_COUNT |
| 7 | #define tid_range id_range |
| 8 | #define tid_space id_space |
| 9 | |
| 10 | static inline uint64_t tid_alloc(struct tid_space *ts) { |
| 11 | return id_space_alloc(is: ts); |
| 12 | } |
| 13 | |
| 14 | static inline void tid_free(struct tid_space *ts, uint64_t id) { |
| 15 | id_space_free(is: ts, id); |
| 16 | } |
| 17 | |
| 18 | static inline struct tid_space *tid_space_init(uint64_t max_id) { |
| 19 | return id_space_init(max_id); |
| 20 | } |
| 21 |