]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/unix/sysv/linux/lowlevellock-futex.h
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / lowlevellock-futex.h
index 907b4c7e1d718b394d068fb21bc8fe4bd73f365b..59e6fd3b8c05444e180108de1dc5ea005d0c845a 100644 (file)
@@ -1,5 +1,5 @@
 /* Low-level locking access to futex facilities.  Linux version.
-   Copyright (C) 2005-2014 Free Software Foundation, Inc.
+   Copyright (C) 2005-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
 
 #if IS_IN (libc) || IS_IN (rtld)
 /* In libc.so or ld.so all futexes are private.  */
-# ifdef __ASSUME_PRIVATE_FUTEX
-#  define __lll_private_flag(fl, private) \
-  ((fl) | FUTEX_PRIVATE_FLAG)
-# else
-#  define __lll_private_flag(fl, private) \
-  ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex))
-# endif
+# define __lll_private_flag(fl, private)                       \
+  ({                                                           \
+    /* Prevent warnings in callers of this macro.  */          \
+    int __lll_private_flag_priv __attribute__ ((unused));      \
+    __lll_private_flag_priv = (private);                       \
+    ((fl) | FUTEX_PRIVATE_FLAG);                               \
+  })
 #else
-# ifdef __ASSUME_PRIVATE_FUTEX
-#  define __lll_private_flag(fl, private) \
+# define __lll_private_flag(fl, private) \
   (((fl) | FUTEX_PRIVATE_FLAG) ^ (private))
-# else
-#  define __lll_private_flag(fl, private) \
-  (__builtin_constant_p (private)                                            \
-   ? ((private) == 0                                                         \
-      ? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex))           \
-      : (fl))                                                                \
-   : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG)                               \
-             & THREAD_GETMEM (THREAD_SELF, header.private_futex))))
-# endif
 #endif
 
 #define lll_futex_syscall(nargs, futexp, op, ...)                       \