diff options
author | Torvald Riegel <triegel@redhat.com> | 2014-12-04 14:12:23 +0100 |
---|---|---|
committer | Torvald Riegel <triegel@redhat.com> | 2015-07-10 13:47:09 +0200 |
commit | a2f0363f817a58c4d3f439aa515a3b1d73efde36 (patch) | |
tree | 6204a1208c1421d573e8c91e4523376a18e1dd60 /nptl/unregister-atfork.c | |
parent | 203c1a898dd2e281eae30f3c57ceb8d4a50b00f4 (diff) | |
download | glibc-a2f0363f817a58c4d3f439aa515a3b1d73efde36.zip glibc-a2f0363f817a58c4d3f439aa515a3b1d73efde36.tar.gz glibc-a2f0363f817a58c4d3f439aa515a3b1d73efde36.tar.bz2 |
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.
Diffstat (limited to 'nptl/unregister-atfork.c')
-rw-r--r-- | nptl/unregister-atfork.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nptl/unregister-atfork.c b/nptl/unregister-atfork.c index 3838cb7..6d08ed7 100644 --- a/nptl/unregister-atfork.c +++ b/nptl/unregister-atfork.c @@ -20,6 +20,7 @@ #include <stdlib.h> #include <fork.h> #include <atomic.h> +#include <futex-internal.h> void @@ -114,7 +115,7 @@ __unregister_atfork (dso_handle) atomic_decrement (&deleted->handler->refcntr); unsigned int val; while ((val = deleted->handler->refcntr) != 0) - lll_futex_wait (&deleted->handler->refcntr, val, LLL_PRIVATE); + futex_wait_simple (&deleted->handler->refcntr, val, FUTEX_PRIVATE); deleted = deleted->next; } |