From f849f3ce2cec1977eda8f6269a64b9426a2ba3e8 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 12 May 2022 00:56:33 +0200 Subject: [PATCH] Use futex semaphores on Linux only --- libs/pbd/pbd/semutils.h | 2 -- wscript | 7 +++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libs/pbd/pbd/semutils.h b/libs/pbd/pbd/semutils.h index fdf3cd7d4c..b1b6bf41f4 100644 --- a/libs/pbd/pbd/semutils.h +++ b/libs/pbd/pbd/semutils.h @@ -21,8 +21,6 @@ #ifndef __pbd_semutils_h__ #define __pbd_semutils_h__ -#define USE_FUTEX_SEMAPHORE - #if (defined PLATFORM_WINDOWS && !defined USE_PTW32_SEMAPHORE) #define WINDOWS_SEMAPHORE 1 #endif diff --git a/wscript b/wscript index 5c0a81e8c0..11b2921943 100644 --- a/wscript +++ b/wscript @@ -936,6 +936,8 @@ def options(opt): help='Turn on PT session import option') opt.add_option('--no-threaded-waveviews', action='store_true', default=False, dest='no_threaded_waveviews', help='Disable threaded waveview rendering') + opt.add_option('--no-futex-semaphore', action='store_true', default=False, dest='no_futex_semaphore', + help='Disable use of futex for semaphores (Linux only)') opt.add_option( '--qm-dsp-include', type='string', action='store', dest='qm_dsp_include', default='/usr/include/qm-dsp', @@ -1340,6 +1342,10 @@ int main () { return 0; } if opts.no_threaded_waveviews: conf.define('NO_THREADED_WAVEVIEWS', 1) conf.env['NO_THREADED_WAVEVIEWS'] = True + if not opts.no_futex_semaphore: + if re.search ("linux", sys.platform) is not None and Options.options.dist_target != 'mingw': + conf.define('USE_FUTEX_SEMAPHORE', 1) + conf.env['USE_FUTEX_SEMAPHORE'] = True backends = opts.with_backends.split(',') @@ -1479,6 +1485,7 @@ const char* const ardour_config_info = "\\n\\ write_config_text('FLAC', conf.is_defined('HAVE_FLAC')) write_config_text('FPU optimization', opts.fpu_optimization) write_config_text('FPU AVX/FMA support', conf.is_defined('FPU_AVX_FMA_SUPPORT')) + write_config_text('Futex Semaphore', conf.is_defined('USE_FUTEX_SEMAPHORE')) write_config_text('Freedesktop files', opts.freedesktop) write_config_text('Libjack linking', conf.env['libjack_link']) write_config_text('Libjack metadata', conf.is_defined ('HAVE_JACK_METADATA'))