list: switch lock to mtx
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
9c50a1df92
commit
e8effb194e
2 changed files with 4 additions and 4 deletions
|
|
@ -17,7 +17,7 @@ typedef struct _list_item {
|
||||||
typedef struct _list_head {
|
typedef struct _list_head {
|
||||||
struct _list_item *head;
|
struct _list_item *head;
|
||||||
struct _list_item *tail;
|
struct _list_item *tail;
|
||||||
spinlock_t lock;
|
mtx_t lock;
|
||||||
} list_t;
|
} list_t;
|
||||||
|
|
||||||
void list_create(list_t *list);
|
void list_create(list_t *list);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
#include <kernel/spinlock.h>
|
#include <kernel/mtx.h>
|
||||||
#include <kernel/types.h>
|
#include <kernel/types.h>
|
||||||
#include <kernel/slab.h>
|
#include <kernel/slab.h>
|
||||||
#include <lib/list.h>
|
#include <lib/list.h>
|
||||||
|
|
@ -67,12 +67,12 @@ void list_remove(list_item_t *item)
|
||||||
|
|
||||||
void list_lock(list_t *list)
|
void list_lock(list_t *list)
|
||||||
{
|
{
|
||||||
spinlock_acquire(&list->lock);
|
mtx_lock(&list->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
void list_unlock(list_t *list)
|
void list_unlock(list_t *list)
|
||||||
{
|
{
|
||||||
spinlock_release(&list->lock);
|
mtx_unlock(&list->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
void list_init()
|
void list_init()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue