mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
futex: statically define table and mutex
This commit is contained in:
@@ -7,9 +7,8 @@
|
||||
#include <kernel/alloc.h>
|
||||
#include <arch/cpu.h>
|
||||
|
||||
static mutex_t futexmutex;
|
||||
static hashtable_t hashtable;
|
||||
static bool hashtableinit;
|
||||
static MUTEX_DEFINE(futexmutex);
|
||||
HASHTABLE_DEFINE_STATIC(hashtable, 256);
|
||||
|
||||
typedef struct {
|
||||
pollheader_t pollheader;
|
||||
@@ -46,16 +45,6 @@ syscallret_t syscall_futex(context_t *, uint32_t *futexp, int op, uint32_t value
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (unlikely(hashtableinit == false)) {
|
||||
if (unlikely(hashtable_init(&hashtable, 256))) {
|
||||
ret.errno = ENOMEM;
|
||||
return ret;
|
||||
}
|
||||
|
||||
hashtableinit = true;
|
||||
MUTEX_INIT(&futexmutex);
|
||||
}
|
||||
|
||||
timespec_t timespec = {0};
|
||||
if (tm) {
|
||||
ret.errno = usercopy_fromuser(×pec, tm, sizeof(timespec_t));
|
||||
|
||||
Reference in New Issue
Block a user