lock: merge spinlock and mtx locks into one

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-08-13 14:19:10 -04:00
commit 2076f1dae1
Signed by: michaelsshaw
GPG key ID: 5A5E0FB20708A9E7
32 changed files with 158 additions and 169 deletions

View file

@ -1,9 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef _ht_H_
#define _ht_H_
#ifndef _HASH_H_
#define _HASH_H_
#include <kernel/common.h>
#include <kernel/mtx.h>
#include <kernel/lock.h>
typedef struct ht_entry {
char *key;
@ -19,7 +19,7 @@ typedef struct {
size_t capacity;
size_t size;
mtx_t lock;
lock_t lock;
} ht_t;
ht_t *ht_create(size_t capacity);
@ -30,4 +30,4 @@ int ht_delete(ht_t *ht, const char *key);
void ht_lock(ht_t *ht);
void ht_unlock(ht_t *ht);
#endif /* _ht_H_ */
#endif /* _HASH_H_ */