mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Plugin Scanning: Fix thread sanitizer issues in the AudioPluginHost
This commit is contained in:
parent
01e71bc351
commit
093dbc7df1
5 changed files with 109 additions and 48 deletions
|
|
@ -51,6 +51,8 @@ struct ChildProcessPingThread : public Thread,
|
|||
pingReceived();
|
||||
}
|
||||
|
||||
void startPinging() { startThread (4); }
|
||||
|
||||
void pingReceived() noexcept { countdown = timeoutMs / 1000 + 1; }
|
||||
void triggerConnectionLostMessage() { triggerAsyncUpdate(); }
|
||||
|
||||
|
|
@ -90,8 +92,7 @@ struct ChildProcessCoordinator::Connection : public InterprocessConnection,
|
|||
ChildProcessPingThread (timeout),
|
||||
owner (m)
|
||||
{
|
||||
if (createPipe (pipeName, timeoutMs))
|
||||
startThread (4);
|
||||
createPipe (pipeName, timeoutMs);
|
||||
}
|
||||
|
||||
~Connection() override
|
||||
|
|
@ -99,6 +100,8 @@ struct ChildProcessCoordinator::Connection : public InterprocessConnection,
|
|||
stopThread (10000);
|
||||
}
|
||||
|
||||
using ChildProcessPingThread::startPinging;
|
||||
|
||||
private:
|
||||
void connectionMade() override {}
|
||||
void connectionLost() override { owner.handleConnectionLost(); }
|
||||
|
|
@ -198,7 +201,6 @@ struct ChildProcessWorker::Connection : public InterprocessConnection,
|
|||
owner (p)
|
||||
{
|
||||
connectToPipe (pipeName, timeoutMs);
|
||||
startThread (4);
|
||||
}
|
||||
|
||||
~Connection() override
|
||||
|
|
@ -207,6 +209,8 @@ struct ChildProcessWorker::Connection : public InterprocessConnection,
|
|||
disconnect();
|
||||
}
|
||||
|
||||
using ChildProcessPingThread::startPinging;
|
||||
|
||||
private:
|
||||
ChildProcessWorker& owner;
|
||||
|
||||
|
|
@ -275,7 +279,9 @@ bool ChildProcessWorker::initialiseFromCommandLine (const String& commandLine,
|
|||
{
|
||||
connection.reset (new Connection (*this, pipeName, timeoutMs <= 0 ? defaultTimeoutMs : timeoutMs));
|
||||
|
||||
if (! connection->isConnected())
|
||||
if (connection->isConnected())
|
||||
connection->startPinging();
|
||||
else
|
||||
connection.reset();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue