mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
Fix window process thread priorities
While POSIX defines a single contiguous range of numbers that determine a thread's priority. Win32 defines priority classes and priority levels relative to these classes. pthread maps those to -15 .. +15 with the top six ones corresponding to REALTIME_PRIORITY_CLASS and max being THREAD_PRIORITY_TIME_CRITICAL Note that the PA backend can USE_MMCSS_THREAD_PRIORITIES and PBD::MMCSS::set_thread_characteristics() directly for the I/O threads.
This commit is contained in:
parent
4d269729b1
commit
28619fe71b
2 changed files with 17 additions and 10 deletions
|
|
@ -288,18 +288,19 @@ pbd_absolute_rt_priority (int policy, int priority)
|
|||
/* use default. XXX this should be relative to audio (JACK) thread,
|
||||
* internal backends use -20 (Audio), -21 (MIDI), -22 (compuation)
|
||||
*/
|
||||
priority = 7; // BaseUI backwards compat.
|
||||
}
|
||||
|
||||
if (priority > 0) {
|
||||
priority = (p_min + p_max) / 2;
|
||||
} else if (priority > 0) {
|
||||
priority += p_min;
|
||||
} else {
|
||||
priority += p_max;
|
||||
priority += p_max + 1;
|
||||
}
|
||||
if (priority > p_max)
|
||||
|
||||
if (priority > p_max) {
|
||||
priority = p_max;
|
||||
if (priority < p_min)
|
||||
}
|
||||
if (priority < p_min) {
|
||||
priority = p_min;
|
||||
}
|
||||
return priority;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue