diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-04-28 13:50:56 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-04-28 13:50:56 +0000 |
commit | e8355c7596eba1f524f096ea8857a4fc65321cfa (patch) | |
tree | e67d6e87c5f1ea43102f6628c554222913d06ed6 /sys/kern/init_main.c | |
parent | 38e6404586671a5cee5b13b7c54b8be33e33daed (diff) |
Add futex(2) syscall based on a sane subset of its Linux equivalent.
The syscall is marked NOLOCK and only FUTEX_WAIT grabs the KERNEL_LOCK()
because of PCATCH and the signal nightmare.
Serialization of threads is currently done with a global & exclusive
rwlock.
Note that the current implementation still use copyin(9) which is not
guaranteed to be atomic. Committing now such that remaining issues can
be addressed in-tree.
With inputs from guenther@, kettenis@ and visa@.
ok deraadt@, visa@
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r-- | sys/kern/init_main.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 9b6291d4352..83550d8c55c 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init_main.c,v 1.268 2017/04/20 12:59:36 visa Exp $ */ +/* $OpenBSD: init_main.c,v 1.269 2017/04/28 13:50:55 mpi Exp $ */ /* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */ /* @@ -144,6 +144,7 @@ void db_ctf_init(void); void prof_init(void); void init_exec(void); void kqueue_init(void); +void futex_init(void); void taskq_init(void); void timeout_proc_init(void); void pool_gc_pages(void *); @@ -264,6 +265,11 @@ main(void *framep) */ kqueue_init(); + /* + * Initialize futexes. + */ + futex_init(); + /* Create credentials. */ p->p_ucred = crget(); p->p_ucred->cr_ngroups = 1; /* group 0 */ |