diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2020-01-21 15:20:48 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2020-01-21 15:20:48 +0000 |
commit | 613562784749fee340b2f66cb8815a65842d5268 (patch) | |
tree | 6fb140df1c2b11ba3aa710c222dde797dcfe27e8 /sys/kern/syscalls.master | |
parent | e9fcad406e5a9de710a1f2f452e67788ddec9282 (diff) |
Make __thrsleep(2) and __thrwakeup(2) MP-safe
Threads in __thrsleep(2) are tracked using queues, one queue per each
process for synchronization between threads of a process, and one
system-wide queue for the special ident -1 handling. Each of these
queues has an associated rwlock that serializes access.
The queue lock is released when calling copyin() and copyout() in
thrsleep(). This preserves the existing behaviour where a blocked copy
operation does not prevent other threads from making progress.
Tested by anton@, claudio@
OK anton@, claudio@, tedu@, mpi@
Diffstat (limited to 'sys/kern/syscalls.master')
-rw-r--r-- | sys/kern/syscalls.master | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index 3d0ef25105a..3d823d74e0b 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -1,4 +1,4 @@ -; $OpenBSD: syscalls.master,v 1.201 2020/01/13 14:01:18 visa Exp $ +; $OpenBSD: syscalls.master,v 1.202 2020/01/21 15:20:47 visa Exp $ ; $NetBSD: syscalls.master,v 1.32 1996/04/23 10:24:21 mycroft Exp $ ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -206,7 +206,7 @@ 92 STD { int sys_fcntl(int fd, int cmd, ... void *arg); } 93 STD { int sys_accept4(int s, struct sockaddr *name, \ socklen_t *anamelen, int flags); } -94 STD { int sys___thrsleep(const volatile void *ident, \ +94 STD NOLOCK { int sys___thrsleep(const volatile void *ident, \ clockid_t clock_id, const struct timespec *tp, \ void *lock, const int *abort); } 95 STD { int sys_fsync(int fd); } @@ -521,7 +521,7 @@ 298 STD { int sys_sched_yield(void); } 299 STD NOLOCK { pid_t sys_getthrid(void); } 300 OBSOL t32___thrsleep -301 STD { int sys___thrwakeup(const volatile void *ident, \ +301 STD NOLOCK { int sys___thrwakeup(const volatile void *ident, \ int n); } 302 STD { void sys___threxit(pid_t *notdead); } 303 STD { int sys___thrsigdivert(sigset_t sigmask, \ |