mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
Correctly set ctrl-surface thread priority
This commit is contained in:
parent
89a0040f1b
commit
6e82f3669f
3 changed files with 13 additions and 3 deletions
|
|
@ -47,6 +47,7 @@
|
|||
#include <boost/algorithm/string/erase.hpp>
|
||||
|
||||
#include "pbd/basename.h"
|
||||
#include "pbd/base_ui.h"
|
||||
#include "pbd/convert.h"
|
||||
#include "pbd/error.h"
|
||||
#include "pbd/file_utils.h"
|
||||
|
|
@ -542,6 +543,8 @@ Session::immediately_post_engine ()
|
|||
_process_graph.reset (new Graph (*this));
|
||||
}
|
||||
|
||||
BaseUI::set_thread_priority (pbd_absolute_rt_priority (PBD_SCHED_FIFO, AudioEngine::instance()->client_real_time_priority () - 3));
|
||||
|
||||
/* every time we reconnect, recompute worst case output latencies */
|
||||
|
||||
_engine.Running.connect_same_thread (*this, boost::bind (&Session::initialize_latencies, this));
|
||||
|
|
|
|||
|
|
@ -50,6 +50,8 @@ using namespace PBD;
|
|||
using namespace Glib;
|
||||
|
||||
uint64_t BaseUI::rt_bit = 1;
|
||||
int BaseUI::_thread_priority = PBD_RT_PRI_PROC - 1;
|
||||
|
||||
BaseUI::RequestType BaseUI::CallSlot = BaseUI::new_request_type();
|
||||
BaseUI::RequestType BaseUI::Quit = BaseUI::new_request_type();
|
||||
|
||||
|
|
@ -83,9 +85,9 @@ BaseUI::new_request_type ()
|
|||
}
|
||||
|
||||
int
|
||||
BaseUI::set_thread_priority (const int policy, int priority) const
|
||||
BaseUI::set_thread_priority () const
|
||||
{
|
||||
return pbd_set_thread_priority (pthread_self(), policy, priority);
|
||||
return pbd_set_thread_priority (pthread_self(), PBD_SCHED_FIFO, _thread_priority);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -62,6 +62,10 @@ class LIBPBD_API BaseUI : public sigc::trackable, public PBD::EventLoop
|
|||
static RequestType CallSlot;
|
||||
static RequestType Quit;
|
||||
|
||||
static void set_thread_priority (int p) {
|
||||
_thread_priority = p;
|
||||
}
|
||||
|
||||
/** start up a thread to run the main loop
|
||||
*/
|
||||
void run ();
|
||||
|
|
@ -93,7 +97,7 @@ class LIBPBD_API BaseUI : public sigc::trackable, public PBD::EventLoop
|
|||
|
||||
virtual void thread_init () {};
|
||||
|
||||
int set_thread_priority (const int policy = PBD_SCHED_FIFO, int priority = 0) const;
|
||||
int set_thread_priority () const;
|
||||
|
||||
/** Called when there input ready on the request_channel
|
||||
*/
|
||||
|
|
@ -114,6 +118,7 @@ class LIBPBD_API BaseUI : public sigc::trackable, public PBD::EventLoop
|
|||
CrossThreadChannel request_channel;
|
||||
|
||||
static uint64_t rt_bit;
|
||||
static int _thread_priority;
|
||||
|
||||
int setup_request_pipe ();
|
||||
void main_thread ();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue