1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Versioning: Add the JUCE version number to any internally created threads

This commit is contained in:
Anthony Nicholls 2024-09-13 17:23:57 +01:00
parent 0e608f77fa
commit 6c2d149ef3
25 changed files with 27 additions and 27 deletions

View file

@ -49,7 +49,7 @@ void MidiInputCallback::handlePartialSysexMessage ([[maybe_unused]] MidiInput* s
//==============================================================================
MidiOutput::MidiOutput (const String& deviceName, const String& deviceIdentifier)
: Thread ("midi out"), deviceInfo (deviceName, deviceIdentifier)
: Thread (SystemStats::getJUCEVersion() + ": midi out"), deviceInfo (deviceName, deviceIdentifier)
{
}

View file

@ -497,7 +497,7 @@ class ALSAThread final : public Thread
{
public:
ALSAThread (const String& inputDeviceID, const String& outputDeviceID)
: Thread ("JUCE ALSA"),
: Thread (SystemStats::getJUCEVersion() + ": ALSA"),
inputId (inputDeviceID),
outputId (outputDeviceID)
{

View file

@ -84,7 +84,7 @@ public:
//==============================================================================
AndroidAudioIODevice (const String& deviceName)
: AudioIODevice (deviceName, javaAudioTypeName),
Thread ("audio"),
Thread (SystemStats::getJUCEVersion() + ": audio"),
minBufferSizeOut (0), minBufferSizeIn (0), callback (nullptr), sampleRate (0),
numClientInputChannels (0), numDeviceInputChannels (0), numDeviceInputChannelsAvailable (2),
numClientOutputChannels (0), numDeviceOutputChannels (0),

View file

@ -759,7 +759,7 @@ public:
const int outputDeviceIndex_,
const int inputDeviceIndex_)
: AudioIODevice (deviceName, "DirectSound"),
Thread ("JUCE DSound"),
Thread (SystemStats::getJUCEVersion() + ": DSound"),
outputDeviceIndex (outputDeviceIndex_),
inputDeviceIndex (inputDeviceIndex_)
{

View file

@ -1029,7 +1029,7 @@ private:
EventRegistrationToken& added,
EventRegistrationToken& removed,
EventRegistrationToken& updated)
: Thread ("WinRT Device Enumeration Thread"), handler (h), watcher (w),
: Thread (SystemStats::getJUCEVersion() + ": WinRT Device Enumeration Thread"), handler (h), watcher (w),
deviceAddedToken (added), deviceRemovedToken (removed), deviceUpdatedToken (updated)
{}

View file

@ -1205,7 +1205,7 @@ public:
const String& inputDeviceID,
WASAPIDeviceMode mode)
: AudioIODevice (deviceName, typeNameIn),
Thread ("JUCE WASAPI"),
Thread (SystemStats::getJUCEVersion() + ": WASAPI"),
outputDeviceId (outputDeviceID),
inputDeviceId (inputDeviceID),
deviceMode (mode)

View file

@ -43,7 +43,7 @@ bool dispatchNextMessageOnSystemQueue (bool returnIfNoPendingMessages);
class MessageThread : public Thread
{
public:
MessageThread() : Thread ("JUCE Plugin Message Thread")
MessageThread() : Thread (SystemStats::getJUCEVersion() + ": Plugin Message Thread")
{
start();
}

View file

@ -69,7 +69,7 @@ private:
//==============================================================================
AudioThumbnailCache::AudioThumbnailCache (const int maxNumThumbs)
: thread ("thumb cache"),
: thread (SystemStats::getJUCEVersion() + ": thumb cache"),
maxNumThumbsToStore (maxNumThumbs)
{
jassert (maxNumThumbsToStore > 0);

View file

@ -316,7 +316,7 @@ private:
{
PairDeviceThread (const String& bluetoothAddressOfDeviceToPair,
AndroidBluetoothMidiDevicesListBox& ownerListBox)
: Thread ("JUCE Bluetooth MIDI Device Pairing Thread"),
: Thread (SystemStats::getJUCEVersion() + ": Bluetooth MIDI Device Pairing Thread"),
bluetoothAddress (bluetoothAddressOfDeviceToPair),
owner (&ownerListBox)
{

View file

@ -259,7 +259,7 @@ private:
{
ReceiverThread (const String& pName, bool shouldCreatePipe,
WaitableEvent& completed)
: NamedPipeThread ("NamePipeSender", pName, shouldCreatePipe, completed)
: NamedPipeThread ("NamePipeReceiver", pName, shouldCreatePipe, completed)
{}
~ReceiverThread() override

View file

@ -42,7 +42,7 @@ struct FallbackDownloadTask final : public URL::DownloadTask,
size_t bufferSizeToUse,
std::unique_ptr<WebInputStream> streamToUse,
URL::DownloadTask::Listener* listenerToUse)
: Thread ("DownloadTask thread"),
: Thread (SystemStats::getJUCEVersion() + ": DownloadTask thread"),
fileStream (std::move (outputStreamToUse)),
stream (std::move (streamToUse)),
bufferSize (bufferSizeToUse),

View file

@ -310,7 +310,7 @@ void Thread::notify() const
//==============================================================================
struct LambdaThread final : public Thread
{
LambdaThread (std::function<void()>&& f) : Thread ("anonymous"), fn (std::move (f)) {}
LambdaThread (std::function<void()>&& f) : Thread (SystemStats::getJUCEVersion() + ": anonymous"), fn (std::move (f)) {}
void run() override
{
@ -496,7 +496,7 @@ class ThreadLocalValueUnitTest final : public UnitTest,
public:
ThreadLocalValueUnitTest()
: UnitTest ("ThreadLocalValue", UnitTestCategories::threads),
Thread ("ThreadLocalValue Thread")
Thread (SystemStats::getJUCEVersion() + ": ThreadLocalValue Thread")
{}
void runTest() override

View file

@ -83,7 +83,7 @@ class BackgroundMessageQueue : private Thread
{
public:
explicit BackgroundMessageQueue (int entries)
: Thread ("Convolution background loader"), queue (entries)
: Thread (SystemStats::getJUCEVersion() + ": Convolution background loader"), queue (entries)
{}
using IncomingCommand = FixedSizeFunction<400, void()>;

View file

@ -58,7 +58,7 @@ static String getCommandLinePrefix (const String& commandLineUniqueID)
struct ChildProcessPingThread : public Thread,
private AsyncUpdater
{
ChildProcessPingThread (int timeout) : Thread ("IPC ping"), timeoutMs (timeout)
ChildProcessPingThread (int timeout) : Thread (SystemStats::getJUCEVersion() + ": IPC ping"), timeoutMs (timeout)
{
pingReceived();
}

View file

@ -37,7 +37,7 @@ namespace juce
struct InterprocessConnection::ConnectionThread final : public Thread
{
ConnectionThread (InterprocessConnection& c) : Thread ("JUCE IPC"), owner (c) {}
ConnectionThread (InterprocessConnection& c) : Thread (SystemStats::getJUCEVersion() + ": IPC"), owner (c) {}
void run() override { owner.runThread(); }
InterprocessConnection& owner;

View file

@ -35,7 +35,7 @@
namespace juce
{
InterprocessConnectionServer::InterprocessConnectionServer() : Thread ("JUCE IPC server")
InterprocessConnectionServer::InterprocessConnectionServer() : Thread (SystemStats::getJUCEVersion() + ": IPC server")
{
}

View file

@ -44,7 +44,7 @@ NetworkServiceDiscovery::Advertiser::Advertiser (const String& serviceTypeUID,
const String& serviceDescription,
int broadcastPortToUse, int connectionPort,
RelativeTime minTimeBetweenBroadcasts)
: Thread ("Discovery_broadcast"),
: Thread (SystemStats::getJUCEVersion() + ": Discovery_broadcast"),
message (serviceTypeUID), broadcastPort (broadcastPortToUse),
minInterval (minTimeBetweenBroadcasts)
{
@ -97,7 +97,7 @@ void NetworkServiceDiscovery::Advertiser::sendBroadcast()
//==============================================================================
NetworkServiceDiscovery::AvailableServiceList::AvailableServiceList (const String& serviceType, int broadcastPort)
: Thread ("Discovery_listen"), serviceTypeUID (serviceType)
: Thread (SystemStats::getJUCEVersion() + ": Discovery_listen"), serviceTypeUID (serviceType)
{
#if JUCE_ANDROID
acquireMulticastLock();

View file

@ -41,7 +41,7 @@ MessageManager::MessageManager() noexcept
JUCE_VERSION_ID
if (JUCEApplicationBase::isStandaloneApp())
Thread::setCurrentThreadName ("JUCE Message Thread");
Thread::setCurrentThreadName (SystemStats::getJUCEVersion() + ": Message Thread");
}
MessageManager::~MessageManager() noexcept

View file

@ -89,7 +89,7 @@ public:
using LockType = CriticalSection;
TimerThread()
: Thread ("JUCE Timer")
: Thread (SystemStats::getJUCEVersion() + ": Timer")
{
timers.reserve (32);
ShutdownDetector::addListener (this);

View file

@ -45,7 +45,7 @@ FileBrowserComponent::FileBrowserComponent (int flags_,
previewComp (previewComp_),
currentPathBox ("path"),
fileLabel ("f", TRANS ("file:")),
thread ("JUCE FileBrowser"),
thread (SystemStats::getJUCEVersion() + ": FileBrowser"),
wasProcessActive (true)
{
// You need to specify one or other of the open/save flags..

View file

@ -49,7 +49,7 @@ public:
Win32NativeFileChooser (Component* parent, int flags, FilePreviewComponent* previewComp,
const File& startingFile, const String& titleToUse,
const String& filtersToUse)
: Thread ("Native Win32 FileChooser"),
: Thread (SystemStats::getJUCEVersion() + ": Native Win32 FileChooser"),
owner (parent),
title (titleToUse),
filtersString (filtersToUse.replaceCharacter (',', ';')),

View file

@ -44,7 +44,7 @@ public:
VBlankThread (ComSmartPtr<IDXGIOutput> out,
HMONITOR mon,
VBlankListener& listener)
: Thread ("VBlankThread"),
: Thread (SystemStats::getJUCEVersion() + ": VBlankThread"),
output (out),
monitor (mon)
{

View file

@ -41,7 +41,7 @@ ThreadWithProgressWindow::ThreadWithProgressWindow (const String& title,
const int cancellingTimeOutMs,
const String& cancelButtonText,
Component* componentToCentreAround)
: Thread ("ThreadWithProgressWindow"),
: Thread (SystemStats::getJUCEVersion() + ": ThreadWithProgressWindow"),
progress (0.0),
timeOutMsWhenCancelling (cancellingTimeOutMs),
wasCancelledByUser (false)

View file

@ -618,7 +618,7 @@ private:
ConnectionThread (Platform& ownerToUse,
URL& url,
const StringArray& headers)
: Thread ("WebBrowserComponent::Platform::ConnectionThread"),
: Thread (SystemStats::getJUCEVersion() + ": WebBrowserComponent::Platform::ConnectionThread"),
owner (ownerToUse),
webInputStream (new WebInputStream (url, true))
{

View file

@ -1222,7 +1222,7 @@ public:
Platform (WebBrowserComponent& browserIn,
const WebBrowserComponent::Options& optionsIn,
const StringArray& userStrings)
: Thread ("Webview"), browser (browserIn), userAgent (optionsIn.getUserAgent())
: Thread (SystemStats::getJUCEVersion() + ": Webview"), browser (browserIn), userAgent (optionsIn.getUserAgent())
{
webKitIsAvailable = WebKitSymbols::getInstance()->isWebKitAvailable();
init (InitialisationData { optionsIn.getNativeIntegrationsEnabled(),