Add os_unfair_lock support.

OS X 10.12 deprecated OSSpinLock; os_unfair_lock is the recommended
replacement.
This commit is contained in:
Jason Evans
2016-11-02 18:09:45 -07:00
parent a99e0fa2d2
commit 3f2b8d9cfa
7 changed files with 42 additions and 0 deletions

View File

@@ -1642,6 +1642,20 @@ if test "x${je_cv_builtin_clz}" = "xyes" ; then
AC_DEFINE([JEMALLOC_HAVE_BUILTIN_CLZ], [ ])
fi
dnl ============================================================================
dnl Check for os_unfair_lock operations as provided on Darwin.
JE_COMPILABLE([Darwin os_unfair_lock_*()], [
#include <os/lock.h>
], [
os_unfair_lock lock = OS_UNFAIR_LOCK_INIT;
os_unfair_lock_lock(&lock);
os_unfair_lock_unlock(&lock);
], [je_cv_os_unfair_lock])
if test "x${je_cv_os_unfair_lock}" = "xyes" ; then
AC_DEFINE([JEMALLOC_OS_UNFAIR_LOCK], [ ])
fi
dnl ============================================================================
dnl Check for spinlock(3) operations as provided on Darwin.