]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/nptl/lowlevellock-futex.h
53fd53d1d46c81aa279628f90c5e1fabfc6c68d4
[thirdparty/glibc.git] / sysdeps / nptl / lowlevellock-futex.h
1 /* Low-level locking access to futex facilities. Stub version.
2 Copyright (C) 2014-2019 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <http://www.gnu.org/licenses/>. */
18
19 #ifndef _LOWLEVELLOCK_FUTEX_H
20 #define _LOWLEVELLOCK_FUTEX_H 1
21
22 #include <errno.h>
23
24
25 /* Values for 'private' parameter of locking macros. Note pthreadP.h
26 optimizes for these exact values, though they are not required. */
27 #define LLL_PRIVATE 0
28 #define LLL_SHARED 128
29
30
31 /* For most of these macros, the return value is never really used.
32 Nevertheless, the protocol is that each one returns a negated errno
33 code for failure or zero for success. (Note that the corresponding
34 Linux system calls can sometimes return positive values for success
35 cases too. We never use those values.) */
36
37
38 /* Wait while *FUTEXP == VAL for an lll_futex_wake call on FUTEXP. */
39 #define lll_futex_wait(futexp, val, private) \
40 lll_futex_timed_wait (futexp, val, NULL, private)
41
42 /* Wait until a lll_futex_wake call on FUTEXP, or TIMEOUT elapses. */
43 #define lll_futex_timed_wait(futexp, val, timeout, private) \
44 -ENOSYS
45
46 /* Verify whether the supplied clockid is supported by
47 lll_futex_clock_wait_bitset. */
48 #define lll_futex_supported_clockid(clockid) \
49 (0)
50
51 /* Wait until a lll_futex_wake call on FUTEXP, or the absolute TIMEOUT
52 measured against CLOCKID elapses. CLOCKID may be CLOCK_REALTIME or
53 CLOCK_MONOTONIC. */
54 #define lll_futex_clock_wait_bitset(futexp, val, clockid, timeout, private) \
55 -ENOSYS
56
57 /* Wake up up to NR waiters on FUTEXP. */
58 #define lll_futex_wake(futexp, nr, private) \
59 -ENOSYS
60
61 /* Wake up up to NR_WAKE waiters on FUTEXP. Move up to NR_MOVE of the
62 rest from waiting on FUTEXP to waiting on MUTEX (a different futex). */
63 #define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
64 -ENOSYS
65
66 /* Wake up up to NR_WAKE waiters on FUTEXP and NR_WAKE2 on FUTEXP2. */
67 #define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \
68 -ENOSYS
69
70
71 /* Like lll_futex_wait (FUTEXP, VAL, PRIVATE) but with the expectation
72 that lll_futex_cmp_requeue_pi (FUTEXP, _, _, MUTEX, _, PRIVATE) will
73 be used to do the wakeup. Confers priority-inheritance behavior on
74 the waiter. */
75 #define lll_futex_wait_requeue_pi(futexp, val, mutex, private) \
76 lll_futex_timed_wait_requeue_pi (futexp, val, NULL, 0, mutex, private)
77
78 /* Like lll_futex_wait_requeue_pi, but with a timeout. */
79 #define lll_futex_timed_wait_requeue_pi(futexp, val, timeout, clockbit, \
80 mutex, private) \
81 -ENOSYS
82
83 /* Like lll_futex_requeue, but pairs with lll_futex_wait_requeue_pi
84 and inherits priority from the waiter. */
85 #define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex, \
86 val, private) \
87 -ENOSYS
88
89 /* Like lll_futex_wait, but acting as a cancellable entrypoint. */
90 #define lll_futex_wait_cancel(futexp, val, private) \
91 -ENOSYS
92
93 /* Like lll_futex_timed_wait, but acting as a cancellable entrypoint. */
94 #define lll_futex_timed_wait_cancel(futexp, val, timeout, private) \
95 -ENOSYS
96
97 #endif /* lowlevellock-futex.h */