From 4abb907a8278c8ab05cd82cb11dfe5a22abc28c5 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 9 Sep 2019 18:48:16 +0200 Subject: Use ProcessThread::init () to set up denormal protection Modifying the MXCSR register only affects the current thread. --- libs/ardour/ardour/process_thread.h | 2 +- libs/ardour/process_thread.cc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/ardour/ardour/process_thread.h b/libs/ardour/ardour/process_thread.h index d4cda5b472..a4ca646d4b 100644 --- a/libs/ardour/ardour/process_thread.h +++ b/libs/ardour/ardour/process_thread.h @@ -37,7 +37,7 @@ public: ProcessThread (); ~ProcessThread (); - static void init(); + void init(); void get_buffers (); void drop_buffers (); diff --git a/libs/ardour/process_thread.cc b/libs/ardour/process_thread.cc index 0cf4bc6f39..196b884100 100644 --- a/libs/ardour/process_thread.cc +++ b/libs/ardour/process_thread.cc @@ -20,6 +20,7 @@ #include +#include "ardour/ardour.h" #include "ardour/buffer.h" #include "ardour/buffer_manager.h" #include "ardour/buffer_set.h" @@ -41,10 +42,13 @@ Glib::Threads::Private ProcessThread::_private_thread_buffers (re void ProcessThread::init () { + /* denormal protection is per thread */ + ARDOUR::setup_fpu (); } ProcessThread::ProcessThread () { + init (); } ProcessThread::~ProcessThread () -- cgit v1.2.3