|
Packit |
6c4009 |
/* Low-level locking access to futex facilities. Stub version.
|
|
Packit |
6c4009 |
Copyright (C) 2014-2018 Free Software Foundation, Inc.
|
|
Packit |
6c4009 |
This file is part of the GNU C Library.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit |
6c4009 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License as published by the Free Software Foundation; either
|
|
Packit |
6c4009 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit |
6c4009 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
6c4009 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
6c4009 |
Lesser General Public License for more details.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License along with the GNU C Library. If not, see
|
|
Packit |
6c4009 |
<http://www.gnu.org/licenses/>. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#ifndef _LOWLEVELLOCK_FUTEX_H
|
|
Packit |
6c4009 |
#define _LOWLEVELLOCK_FUTEX_H 1
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#include <errno.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Values for 'private' parameter of locking macros. Note pthreadP.h
|
|
Packit |
6c4009 |
optimizes for these exact values, though they are not required. */
|
|
Packit |
6c4009 |
#define LLL_PRIVATE 0
|
|
Packit |
6c4009 |
#define LLL_SHARED 128
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* For most of these macros, the return value is never really used.
|
|
Packit |
6c4009 |
Nevertheless, the protocol is that each one returns a negated errno
|
|
Packit |
6c4009 |
code for failure or zero for success. (Note that the corresponding
|
|
Packit |
6c4009 |
Linux system calls can sometimes return positive values for success
|
|
Packit |
6c4009 |
cases too. We never use those values.) */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Wait while *FUTEXP == VAL for an lll_futex_wake call on FUTEXP. */
|
|
Packit |
6c4009 |
#define lll_futex_wait(futexp, val, private) \
|
|
Packit |
6c4009 |
lll_futex_timed_wait (futexp, val, NULL, private)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Wait until a lll_futex_wake call on FUTEXP, or TIMEOUT elapses. */
|
|
Packit |
6c4009 |
#define lll_futex_timed_wait(futexp, val, timeout, private) \
|
|
Packit |
6c4009 |
-ENOSYS
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* This macro should be defined only if FUTEX_CLOCK_REALTIME is also defined.
|
|
Packit |
6c4009 |
If CLOCKBIT is zero, this is identical to lll_futex_timed_wait.
|
|
Packit |
6c4009 |
If CLOCKBIT has FUTEX_CLOCK_REALTIME set, then it's the same but
|
|
Packit |
6c4009 |
TIMEOUT is counted by CLOCK_REALTIME rather than CLOCK_MONOTONIC. */
|
|
Packit |
6c4009 |
#define lll_futex_timed_wait_bitset(futexp, val, timeout, clockbit, private) \
|
|
Packit |
6c4009 |
-ENOSYS
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Wake up up to NR waiters on FUTEXP. */
|
|
Packit |
6c4009 |
#define lll_futex_wake(futexp, nr, private) \
|
|
Packit |
6c4009 |
-ENOSYS
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Wake up up to NR_WAKE waiters on FUTEXP. Move up to NR_MOVE of the
|
|
Packit |
6c4009 |
rest from waiting on FUTEXP to waiting on MUTEX (a different futex). */
|
|
Packit |
6c4009 |
#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
|
|
Packit |
6c4009 |
-ENOSYS
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Wake up up to NR_WAKE waiters on FUTEXP and NR_WAKE2 on FUTEXP2. */
|
|
Packit |
6c4009 |
#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \
|
|
Packit |
6c4009 |
-ENOSYS
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Like lll_futex_wait (FUTEXP, VAL, PRIVATE) but with the expectation
|
|
Packit |
6c4009 |
that lll_futex_cmp_requeue_pi (FUTEXP, _, _, MUTEX, _, PRIVATE) will
|
|
Packit |
6c4009 |
be used to do the wakeup. Confers priority-inheritance behavior on
|
|
Packit |
6c4009 |
the waiter. */
|
|
Packit |
6c4009 |
#define lll_futex_wait_requeue_pi(futexp, val, mutex, private) \
|
|
Packit |
6c4009 |
lll_futex_timed_wait_requeue_pi (futexp, val, NULL, 0, mutex, private)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Like lll_futex_wait_requeue_pi, but with a timeout. */
|
|
Packit |
6c4009 |
#define lll_futex_timed_wait_requeue_pi(futexp, val, timeout, clockbit, \
|
|
Packit |
6c4009 |
mutex, private) \
|
|
Packit |
6c4009 |
-ENOSYS
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Like lll_futex_requeue, but pairs with lll_futex_wait_requeue_pi
|
|
Packit |
6c4009 |
and inherits priority from the waiter. */
|
|
Packit |
6c4009 |
#define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex, \
|
|
Packit |
6c4009 |
val, private) \
|
|
Packit |
6c4009 |
-ENOSYS
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#endif /* lowlevellock-futex.h */
|