Tests
All checks were successful
CI / React UI Build (push) Successful in 10s
CI / Native Windows Build And Tests (push) Successful in 2m26s
CI / Windows Release Package (push) Successful in 2m28s

This commit is contained in:
Aiden
2026-05-11 15:59:29 +10:00
parent a9b08f7f27
commit 6e600be112
14 changed files with 550 additions and 57 deletions

View File

@@ -7,6 +7,11 @@
#include "RuntimeStore.h"
#include <windows.h>
namespace
{
constexpr auto kCompatibilityPollFallbackInterval = std::chrono::milliseconds(250);
}
ControlServices::ControlServices(RuntimeEventDispatcher& runtimeEventDispatcher) :
mControlServer(std::make_unique<ControlServer>()),
mOscServer(std::make_unique<OscServer>()),
@@ -130,6 +135,7 @@ bool ControlServices::QueueOscCommit(const std::string& routeKey, const std::str
std::lock_guard<std::mutex> lock(mPendingOscCommitMutex);
mPendingOscCommits[routeKey] = std::move(commit);
}
WakePolling();
return true;
}
@@ -184,6 +190,7 @@ void ControlServices::StopPolling()
if (!mPollRunning.exchange(false))
return;
WakePolling();
if (mPollThread.joinable())
mPollThread.join();
}
@@ -224,11 +231,23 @@ void ControlServices::PollLoop(RuntimeCoordinator& runtimeCoordinator)
if (pollResult.runtimeStateBroadcastRequired || pollResult.shaderBuildRequested || pollResult.compileStatusChanged)
QueueRuntimeCoordinatorResult(pollResult, pollResult.compileStatusChanged && !pollResult.compileStatusSucceeded && !pollResult.compileStatusMessage.empty());
for (int i = 0; i < 25 && mPollRunning; ++i)
Sleep(10);
std::unique_lock<std::mutex> wakeLock(mPollWakeMutex);
mPollWakeCondition.wait_for(wakeLock, kCompatibilityPollFallbackInterval, [this]() {
return !mPollRunning.load() || mPollWakeRequested;
});
mPollWakeRequested = false;
}
}
void ControlServices::WakePolling()
{
{
std::lock_guard<std::mutex> lock(mPollWakeMutex);
mPollWakeRequested = true;
}
mPollWakeCondition.notify_one();
}
void ControlServices::QueueRuntimeCoordinatorResult(const RuntimeCoordinatorResult& result, bool failed)
{
RuntimeCoordinatorServiceResult serviceResult;