lock: merge spinlock and mtx locks into one

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-08-13 14:19:10 -04:00
commit 2076f1dae1
Signed by: michaelsshaw
GPG key ID: 5A5E0FB20708A9E7
32 changed files with 158 additions and 169 deletions

View file

@ -76,7 +76,7 @@ static int sys_open(const char *path, int flags)
if (res < 0)
return res;
spinlock_acquire(&thread->fd_lock);
spin_lock(&thread->fd_lock);
int fdno = -1;
@ -109,7 +109,7 @@ static int sys_open(const char *path, int flags)
fdno = osize;
}
spinlock_release(&thread->fd_lock);
spin_unlock(&thread->fd_lock);
return fdno;
}
@ -125,12 +125,12 @@ static int sys_close(int fd)
if (!f->dirent)
return -EBADF;
spinlock_acquire(&thread->fd_lock);
spin_lock(&thread->fd_lock);
vfs_close(f->dirent);
memset(f, 0, sizeof(struct file));
spinlock_acquire(&thread->fd_lock);
spin_lock(&thread->fd_lock);
return 0;
}