mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
poll: use spinlocks rather than mutexes for use in higher IPLs
This commit is contained in:
@@ -3,21 +3,20 @@
|
||||
|
||||
#include <kernel/scheduler.h>
|
||||
#include <spinlock.h>
|
||||
#include <mutex.h>
|
||||
|
||||
struct polldata;
|
||||
|
||||
typedef struct {
|
||||
thread_t *thread;
|
||||
spinlock_t lock;
|
||||
mutex_t eventlock;
|
||||
spinlock_t eventlock;
|
||||
struct polldata *data;
|
||||
struct polldata *event;
|
||||
size_t size;
|
||||
} polldesc_t;
|
||||
|
||||
typedef struct {
|
||||
mutex_t lock;
|
||||
spinlock_t lock;
|
||||
struct polldata *data;
|
||||
} pollheader_t;
|
||||
|
||||
@@ -31,7 +30,7 @@ typedef struct polldata {
|
||||
} polldata_t;
|
||||
|
||||
#define POLL_INITHEADER(x) \
|
||||
MUTEX_INIT(&(x)->lock);
|
||||
SPINLOCK_INIT((x)->lock);
|
||||
|
||||
int poll_initdesc(polldesc_t *, size_t size);
|
||||
void poll_add(pollheader_t *, polldata_t *, int events);
|
||||
|
||||
Reference in New Issue
Block a user