Files
mop3/kernel/id/id_alloc.h
kamkow1 e5ebd7f3ba
All checks were successful
Build ISO image / build-and-deploy (push) Successful in 2m21s
Build documentation / build-and-deploy (push) Successful in 54s
Use a big-lock for kernel sychronization instead of fine-grained locking
2026-04-27 18:06:02 +02:00

22 lines
400 B
C

#ifndef _KERNEL_ID_ID_ALLOC_H
#define _KERNEL_ID_ID_ALLOC_H
#include <libk/bm.h>
#include <libk/std.h>
#include <sync/spin_lock.h>
struct id_alloc {
struct bm bm;
int next_id;
};
int id_alloc(struct id_alloc* ida);
void id_free(struct id_alloc* ida, int id);
bool id_alloc_init(struct id_alloc* ida, size_t nbits);
void id_alloc_fini(struct id_alloc* ida);
#endif // _KERNEL_ID_ID_ALLOC_H