Fix: Replace removed juce::Thread::setCurrentThreadPriority with native pthread priority (macOS)
Browse files
Source/Helper/HelperPluginHost.cpp
CHANGED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
#include "HelperPluginHost.h"
|
| 2 |
#include "Constants.h"
|
| 3 |
#include <juce_audio_basics/juce_audio_basics.h>
|
|
|
|
|
|
|
| 4 |
|
| 5 |
HelperPluginHost::HelperPluginHost()
|
| 6 |
{
|
|
@@ -117,7 +119,10 @@ void HelperPluginHost::stopProcessing()
|
|
| 117 |
|
| 118 |
void HelperPluginHost::audioProcessingLoop()
|
| 119 |
{
|
| 120 |
-
|
|
|
|
|
|
|
|
|
|
| 121 |
|
| 122 |
while (processing.load())
|
| 123 |
{
|
|
|
|
| 1 |
#include "HelperPluginHost.h"
|
| 2 |
#include "Constants.h"
|
| 3 |
#include <juce_audio_basics/juce_audio_basics.h>
|
| 4 |
+
#include <pthread.h>
|
| 5 |
+
#include <sched.h>
|
| 6 |
|
| 7 |
HelperPluginHost::HelperPluginHost()
|
| 8 |
{
|
|
|
|
| 119 |
|
| 120 |
void HelperPluginHost::audioProcessingLoop()
|
| 121 |
{
|
| 122 |
+
// Set realtime thread priority using native macOS/POSIX API
|
| 123 |
+
struct sched_param param;
|
| 124 |
+
param.sched_priority = sched_get_priority_max(SCHED_FIFO);
|
| 125 |
+
pthread_setschedparam(pthread_self(), SCHED_FIFO, ¶m);
|
| 126 |
|
| 127 |
while (processing.load())
|
| 128 |
{
|