lock: merge spinlock and mtx locks into one
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
3e5abada9b
commit
2076f1dae1
32 changed files with 158 additions and 169 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue