futex: statically define table and mutex

This commit is contained in:
Matheus
2026-04-23 15:31:05 -03:00
parent 71dd6d1125
commit 6678472362
+2 -13
View File
@@ -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(&timespec, tm, sizeof(timespec_t));