Breaking Change for JUCE 7.0.3 with Thread::startThread

There are no Breaking Changes listed for JUCE 7.0.3, but I just found one. Thread::startThread (int priority) has been replaced by Thread::startThread (Priority threadPriority).

In 7.0.2 and before, the int priority parameter could be in the range from 0 - 10. Comments for the method noted:

Launches the thread with a given priority, where 0 = lowest, 10 = highest.
If the thread is already running, its priority will be changed.

Now the int parameter has been replaced by a Priority value. Because it’s an enum class, it’s not implicitly convertible to its integer value, but even if it was (or you used static_cast to convert it), the new integer range is [-2, 2], rather than [0, 10].

So, maybe add this to Breaking Changes?

WHOOPS, just saw that this was actually listed under 7.0.2 breaking changes, although I had been using 7.0.2 and it was still working fine with that.

that’s a typo.
line 4 should be Version 7.0.3 and not Version 7.0.2 (which is already line 230)

1 Like

Ah, good, that explains it!

I got around this with the following change:

diff --git a/State/foleys_MagicGUIState.cpp b/State/foleys_MagicGUIState.cpp
index 077df3f..93708f0 100644
--- a/State/foleys_MagicGUIState.cpp
+++ b/State/foleys_MagicGUIState.cpp
@@ -53,7 +53,7 @@ void MagicGUIState::addBackgroundProcessing (MagicPlotSource* source)
     if (auto* job = source->getBackgroundJob())
     {
         visualiserThread.addTimeSliceClient (job);
-        visualiserThread.startThread (3);
+        visualiserThread.startThread (juce::Thread::Priority::low); // JOS: was 3
     }
 }