poll: use spinlocks rather than mutexes for use in higher IPLs

This commit is contained in:
Matheus
2024-04-07 16:34:40 -03:00
parent ae1186c835
commit e17583de1b
2 changed files with 29 additions and 21 deletions
+3 -4
View File
@@ -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);