On Fri, Sep 02, 2016 at 03:36:50PM +0200, Michal Mazurek wrote:
> Here is a working futex implementation for OpenBSD. This diff touches
> the kernel and librthread.
>
> * get rid of tickets from rthreads, they were getting in the way and are
> unused anyway
> * replace all struct _spinlock with int
> * use futexes instead of spinlocks everywhere within librthread
> * librthread no longer calls sched_yield(), nor does it spin
>
> Any comments?
> [...]
There's a tiny bit missing from the patch:
Index: libc/Symbols.list
===================================================================
RCS file: /mnt/media/cvs/src/lib/libc/Symbols.list,v
retrieving revision 1.49
diff -u -p -r1.49 Symbols.list
--- libc/Symbols.list 1 Sep 2016 10:41:02 -0000 1.49
+++ libc/Symbols.list 3 Sep 2016 09:54:58 -0000
@@ -272,6 +272,7 @@ fstatat
fstatfs
fsync
ftruncate
+futex
futimens
futimes
getdents
Index: libc/sys/Makefile.inc
===================================================================
RCS file: /mnt/media/cvs/src/lib/libc/sys/Makefile.inc,v
retrieving revision 1.146
diff -u -p -r1.146 Makefile.inc
--- libc/sys/Makefile.inc 4 Jul 2016 18:01:44 -0000 1.146
+++ libc/sys/Makefile.inc 3 Sep 2016 09:53:03 -0000
@@ -87,6 +87,7 @@ DASM= ${ASM:.o=.do}
# syscalls that CANNOT FAIL. They can return whatever value they want,
# they just never want to set errno.
ASM_NOERR=__get_tcb.o __set_tcb.o __threxit.o __thrsleep.o __thrwakeup.o \
+ futex.o \
getdtablecount.o getegid.o geteuid.o getgid.o getlogin_r.o \
getpgrp.o getpid.o getppid.o getrtable.o getthrid.o getuid.o \
issetugid.o \
Otherwise, the calls to futex() in librthread can't be resolved. I'm
currently building Firefox to see how it works out.
--
Gregor
--
Honesty is the best policy, but insanity is a better defense.