Correctly set ctrl-surface thread priority
This commit is contained in:
@@ -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 ();
|
||||
|
||||
Reference in New Issue
Block a user