lock: merge spinlock and mtx locks into one
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
3e5abada9b
commit
2076f1dae1
32 changed files with 158 additions and 169 deletions
|
|
@ -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_ */
|
||||
|
|
|
|||
Loading…
Reference in a new issue