Hide most of the private futex functions.

Also hide part of the system properties compatibility code, since
we needed to touch that to keep it building.

I'll remove __futex_syscall4 and futex in a later patch.

Bug: 11156955
Change-Id: Ibbf42414c5bb07fb9f1c4a169922844778e4eeae
This commit is contained in:
Elliott Hughes
2014-05-21 18:27:40 -07:00
parent f97d8713a2
commit d5ed63a6a8
11 changed files with 36 additions and 337 deletions

View File

@@ -30,20 +30,30 @@
#include <linux/futex.h>
#include <sys/cdefs.h>
#include <stdbool.h>
#include <stddef.h>
__BEGIN_DECLS
extern int __futex_wait(volatile void *ftx, int val, const struct timespec *timeout);
extern int __futex_wake(volatile void *ftx, int count);
struct timespec;
extern int __futex_syscall3(volatile void *ftx, int op, int val);
extern int __futex_syscall4(volatile void *ftx, int op, int val, const struct timespec *timeout);
extern int __futex_syscall4(volatile void* ftx, int op, int value, const struct timespec* timeout);
/* Like __futex_wait/wake, but take an additional 'pshared' argument.
* when non-0, this will use normal futexes. Otherwise, private futexes.
*/
__LIBC_HIDDEN__ int __futex_wake_ex(volatile void* ftx, int pshared, int val);
__LIBC_HIDDEN__ int __futex_wait_ex(volatile void* ftx, int pshared, int val, const struct timespec* timeout);
static inline int __futex_wake(volatile void* ftx, int count) {
return __futex_syscall4(ftx, FUTEX_WAKE, count, NULL);
}
static inline int __futex_wake_ex(volatile void* ftx, bool shared, int count) {
return __futex_syscall4(ftx, shared ? FUTEX_WAKE : FUTEX_WAKE_PRIVATE, count, NULL);
}
static inline int __futex_wait(volatile void* ftx, int value, const struct timespec* timeout) {
return __futex_syscall4(ftx, FUTEX_WAIT, value, timeout);
}
static inline int __futex_wait_ex(volatile void* ftx, bool shared, int value, const struct timespec* timeout) {
return __futex_syscall4(ftx, shared ? FUTEX_WAIT : FUTEX_WAIT_PRIVATE, value, timeout);
}
__END_DECLS