S390: Use C11-like atomics instead of plain memory accesses in lock elision code.
[glibc.git] / sysdeps / unix / sysv / linux / s390 / lowlevellock.h
blobada2e5b4846fef55f9b2dc01042e1add3b2dc877
1 /* Copyright (C) 2003-2016 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
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.
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.
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/>. */
19 #ifndef _S390_LOWLEVELLOCK_H
20 #define _S390_LOWLEVELLOCK_H 1
22 #include <sysdeps/nptl/lowlevellock.h>
24 /* Transactional lock elision definitions. */
25 # ifdef ENABLE_LOCK_ELISION
26 extern int __lll_timedlock_elision
27 (int *futex, short *adapt_count, const struct timespec *timeout, int private)
28 attribute_hidden;
30 # define lll_timedlock_elision(futex, adapt_count, timeout, private) \
31 __lll_timedlock_elision(&(futex), &(adapt_count), timeout, private)
33 extern int __lll_lock_elision (int *futex, short *adapt_count, int private)
34 attribute_hidden;
36 extern int __lll_unlock_elision(int *futex, int private)
37 attribute_hidden;
39 extern int __lll_trylock_elision(int *futex, short *adapt_count)
40 attribute_hidden;
42 # define lll_lock_elision(futex, adapt_count, private) \
43 __lll_lock_elision (&(futex), &(adapt_count), private)
44 # define lll_unlock_elision(futex, adapt_count, private) \
45 __lll_unlock_elision (&(futex), private)
46 # define lll_trylock_elision(futex, adapt_count) \
47 __lll_trylock_elision(&(futex), &(adapt_count))
48 # endif /* ENABLE_LOCK_ELISION */
50 #endif /* lowlevellock.h */