From a2f0363f817a58c4d3f439aa515a3b1d73efde36 Mon Sep 17 00:00:00 2001 From: Torvald Riegel Date: Thu, 4 Dec 2014 14:12:23 +0100 Subject: Add and use new glibc-internal futex API. This adds new functions for futex operations, starting with wait, abstimed_wait, reltimed_wait, wake. They add documentation and error checking according to the current draft of the Linux kernel futex manpage. Waiting with absolute or relative timeouts is split into separate functions. This allows for removing a few cases of code duplication in pthreads code, which uses absolute timeouts; also, it allows us to put platform-specific code to go from an absolute to a relative timeout into the platform-specific futex abstractions.. Futex operations that can be canceled are also split out into separate functions suffixed by "_cancelable". There are separate versions for both Linux and NaCl; while they currently differ only slightly, my expectation is that the separate versions of lowlevellock-futex.h will eventually be merged into futex-internal.h when we get to move the lll_ functions over to the new futex API. --- sysdeps/nptl/fork.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sysdeps/nptl/fork.c') diff --git a/sysdeps/nptl/fork.c b/sysdeps/nptl/fork.c index 74482b7a38..2b9ae4b571 100644 --- a/sysdeps/nptl/fork.c +++ b/sysdeps/nptl/fork.c @@ -30,6 +30,7 @@ #include #include #include +#include static void @@ -219,7 +220,7 @@ __libc_fork (void) if (atomic_decrement_and_test (&allp->handler->refcntr) && allp->handler->need_signal) - lll_futex_wake (&allp->handler->refcntr, 1, LLL_PRIVATE); + futex_wake (&allp->handler->refcntr, 1, FUTEX_PRIVATE); allp = allp->next; } -- cgit 1.4.1