summaryrefslogtreecommitdiff
path: root/glib/gbitlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'glib/gbitlock.c')
-rw-r--r--glib/gbitlock.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/glib/gbitlock.c b/glib/gbitlock.c
index 81bfb339f..9c34de80c 100644
--- a/glib/gbitlock.c
+++ b/glib/gbitlock.c
@@ -35,6 +35,7 @@
#ifdef G_BIT_LOCK_FORCE_FUTEX_EMULATION
#undef HAVE_FUTEX
+#undef HAVE_FUTEX_TIME64
#endif
#ifndef HAVE_FUTEX
@@ -42,7 +43,7 @@ static GMutex g_futex_mutex;
static GSList *g_futex_address_list = NULL;
#endif
-#ifdef HAVE_FUTEX
+#if defined(HAVE_FUTEX) || defined(HAVE_FUTEX_TIME64)
/*
* We have headers for futex(2) on the build machine. This does not
* imply that every system that ever runs the resulting glib will have
@@ -51,14 +52,6 @@ static GSList *g_futex_address_list = NULL;
*
* If anyone actually gets bit by this, please file a bug. :)
*/
-#include <linux/futex.h>
-#include <sys/syscall.h>
-#include <unistd.h>
-
-#ifndef FUTEX_WAIT_PRIVATE
-#define FUTEX_WAIT_PRIVATE FUTEX_WAIT
-#define FUTEX_WAKE_PRIVATE FUTEX_WAKE
-#endif
/* < private >
* g_futex_wait:
@@ -81,7 +74,7 @@ static void
g_futex_wait (const gint *address,
gint value)
{
- syscall (__NR_futex, address, (gsize) FUTEX_WAIT_PRIVATE, (gsize) value, NULL);
+ g_futex_simple (address, (gsize) FUTEX_WAIT_PRIVATE, (gsize) value, NULL);
}
/* < private >
@@ -98,7 +91,7 @@ g_futex_wait (const gint *address,
static void
g_futex_wake (const gint *address)
{
- syscall (__NR_futex, address, (gsize) FUTEX_WAKE_PRIVATE, (gsize) 1, NULL);
+ g_futex_simple (address, (gsize) FUTEX_WAKE_PRIVATE, (gsize) 1, NULL);
}
#else