From 711c241f6c7e18c5403602375a733af74df76f83 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 29 Jun 2020 01:40:30 -0700 Subject: [PATCH] m[mutex] Remove busyloop mutex implemenation Don't know why I ever added this. :) --- configure.ac | 5 ----- meson.build | 3 --- src/hb-mutex.hh | 18 ------------------ 3 files changed, 26 deletions(-) diff --git a/configure.ac b/configure.ac index 2e16b4861..de22f5185 100644 --- a/configure.ac +++ b/configure.ac @@ -449,11 +449,6 @@ if $hb_cv_have_solaris_atomic_ops; then AC_DEFINE(HAVE_SOLARIS_ATOMIC_OPS, 1, [Have Solaris __machine_*_barrier and atomic_* operations]) fi -if test "$os_win32" = no && ! $have_pthread; then - AC_CHECK_HEADERS(sched.h) - AC_SEARCH_LIBS(sched_yield,rt,AC_DEFINE(HAVE_SCHED_YIELD, 1, [Have sched_yield])) -fi - dnl =========================================================================== AC_CONFIG_FILES([ diff --git a/meson.build b/meson.build index 83c179967..71073e26e 100644 --- a/meson.build +++ b/meson.build @@ -285,9 +285,6 @@ if host_machine.system() != 'windows' if thread_dep.found() conf.set('HAVE_PTHREAD', 1) - else - check_headers += ['sched.h'] - check_funcs += ['sched_yield', {'link_with': 'rt'}] endif endif diff --git a/src/hb-mutex.hh b/src/hb-mutex.hh index 56392d049..2fc8d7ee5 100644 --- a/src/hb-mutex.hh +++ b/src/hb-mutex.hh @@ -73,24 +73,6 @@ typedef CRITICAL_SECTION hb_mutex_impl_t; #define hb_mutex_impl_finish(M) DeleteCriticalSection (M) -#elif !defined(HB_NO_MT) && defined(HAVE_INTEL_ATOMIC_PRIMITIVES) - -#if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_YIELD) -# include -# define HB_SCHED_YIELD() sched_yield () -#else -# define HB_SCHED_YIELD() HB_STMT_START {} HB_STMT_END -#endif - -/* This actually is not a totally awful implementation. */ -typedef volatile int hb_mutex_impl_t; -#define HB_MUTEX_IMPL_INIT 0 -#define hb_mutex_impl_init(M) *(M) = 0 -#define hb_mutex_impl_lock(M) HB_STMT_START { while (__sync_lock_test_and_set((M), 1)) HB_SCHED_YIELD (); } HB_STMT_END -#define hb_mutex_impl_unlock(M) __sync_lock_release (M) -#define hb_mutex_impl_finish(M) HB_STMT_START {} HB_STMT_END - - #elif defined(HB_NO_MT) typedef int hb_mutex_impl_t;