phase 2 progress
This commit is contained in:
@@ -166,17 +166,6 @@ void ControlServices::ConsumeCompletedOscCommits(std::vector<CompletedOscCommit>
|
||||
completedCommits.swap(mCompletedOscCommits);
|
||||
}
|
||||
|
||||
void ControlServices::ConsumeRuntimeCoordinatorResults(std::vector<RuntimeCoordinatorServiceResult>& results)
|
||||
{
|
||||
results.clear();
|
||||
|
||||
std::lock_guard<std::mutex> lock(mRuntimeCoordinatorResultMutex);
|
||||
if (mRuntimeCoordinatorResults.empty())
|
||||
return;
|
||||
|
||||
results.swap(mRuntimeCoordinatorResults);
|
||||
}
|
||||
|
||||
void ControlServices::StartPolling(RuntimeCoordinator& runtimeCoordinator)
|
||||
{
|
||||
if (mPollRunning.exchange(true))
|
||||
@@ -218,7 +207,6 @@ void ControlServices::PollLoop(RuntimeCoordinator& runtimeCoordinator)
|
||||
completedCommit.generation = entry.second.generation;
|
||||
std::lock_guard<std::mutex> lock(mCompletedOscCommitMutex);
|
||||
mCompletedOscCommits.push_back(std::move(completedCommit));
|
||||
QueueRuntimeCoordinatorResult(result);
|
||||
}
|
||||
else if (!result.errorMessage.empty())
|
||||
{
|
||||
@@ -228,8 +216,8 @@ void ControlServices::PollLoop(RuntimeCoordinator& runtimeCoordinator)
|
||||
|
||||
bool registryChanged = false;
|
||||
const RuntimeCoordinatorResult pollResult = runtimeCoordinator.PollRuntimeStoreChanges(registryChanged);
|
||||
if (pollResult.runtimeStateBroadcastRequired || pollResult.shaderBuildRequested || pollResult.compileStatusChanged)
|
||||
QueueRuntimeCoordinatorResult(pollResult, pollResult.compileStatusChanged && !pollResult.compileStatusSucceeded && !pollResult.compileStatusMessage.empty());
|
||||
if (pollResult.compileStatusChanged && !pollResult.compileStatusSucceeded && !pollResult.compileStatusMessage.empty())
|
||||
OutputDebugStringA(("Runtime poll failed: " + pollResult.compileStatusMessage + "\n").c_str());
|
||||
|
||||
std::unique_lock<std::mutex> wakeLock(mPollWakeMutex);
|
||||
mPollWakeCondition.wait_for(wakeLock, kCompatibilityPollFallbackInterval, [this]() {
|
||||
@@ -248,16 +236,6 @@ void ControlServices::WakePolling()
|
||||
mPollWakeCondition.notify_one();
|
||||
}
|
||||
|
||||
void ControlServices::QueueRuntimeCoordinatorResult(const RuntimeCoordinatorResult& result, bool failed)
|
||||
{
|
||||
RuntimeCoordinatorServiceResult serviceResult;
|
||||
serviceResult.result = result;
|
||||
serviceResult.failed = failed;
|
||||
|
||||
std::lock_guard<std::mutex> lock(mRuntimeCoordinatorResultMutex);
|
||||
mRuntimeCoordinatorResults.push_back(std::move(serviceResult));
|
||||
}
|
||||
|
||||
void ControlServices::PublishRuntimeStateBroadcastRequested(const std::string& reason)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -20,12 +20,6 @@ class OscServer;
|
||||
class RuntimeEventDispatcher;
|
||||
class RuntimeStore;
|
||||
|
||||
struct RuntimeCoordinatorServiceResult
|
||||
{
|
||||
RuntimeCoordinatorResult result;
|
||||
bool failed = false;
|
||||
};
|
||||
|
||||
class ControlServices
|
||||
{
|
||||
public:
|
||||
@@ -56,7 +50,6 @@ public:
|
||||
bool QueueOscCommit(const std::string& routeKey, const std::string& layerKey, const std::string& parameterKey, const JsonValue& value, uint64_t generation, std::string& error);
|
||||
void ClearOscState();
|
||||
void ConsumeCompletedOscCommits(std::vector<CompletedOscCommit>& completedCommits);
|
||||
void ConsumeRuntimeCoordinatorResults(std::vector<RuntimeCoordinatorServiceResult>& results);
|
||||
|
||||
private:
|
||||
struct PendingOscUpdate
|
||||
@@ -79,7 +72,6 @@ private:
|
||||
void StopPolling();
|
||||
void PollLoop(RuntimeCoordinator& runtimeCoordinator);
|
||||
void WakePolling();
|
||||
void QueueRuntimeCoordinatorResult(const RuntimeCoordinatorResult& result, bool failed = false);
|
||||
void PublishRuntimeStateBroadcastRequested(const std::string& reason);
|
||||
void PublishOscValueReceived(const PendingOscUpdate& update, const std::string& routeKey);
|
||||
void PublishOscCommitRequested(const PendingOscCommit& commit);
|
||||
@@ -92,8 +84,6 @@ private:
|
||||
std::mutex mPollWakeMutex;
|
||||
std::condition_variable mPollWakeCondition;
|
||||
bool mPollWakeRequested = false;
|
||||
std::mutex mRuntimeCoordinatorResultMutex;
|
||||
std::vector<RuntimeCoordinatorServiceResult> mRuntimeCoordinatorResults;
|
||||
std::mutex mPendingOscMutex;
|
||||
std::map<std::string, PendingOscUpdate> mPendingOscUpdates;
|
||||
std::mutex mPendingOscCommitMutex;
|
||||
|
||||
@@ -78,14 +78,3 @@ void RuntimeServices::ConsumeCompletedOscCommits(std::vector<CompletedOscCommit>
|
||||
|
||||
mControlServices->ConsumeCompletedOscCommits(completedCommits);
|
||||
}
|
||||
|
||||
void RuntimeServices::ConsumeRuntimeCoordinatorResults(std::vector<RuntimeCoordinatorServiceResult>& results)
|
||||
{
|
||||
if (!mControlServices)
|
||||
{
|
||||
results.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
mControlServices->ConsumeRuntimeCoordinatorResults(results);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ public:
|
||||
bool QueueOscCommit(const std::string& routeKey, const std::string& layerKey, const std::string& parameterKey, const JsonValue& value, uint64_t generation, std::string& error);
|
||||
void ClearOscState();
|
||||
void ConsumeCompletedOscCommits(std::vector<CompletedOscCommit>& completedCommits);
|
||||
void ConsumeRuntimeCoordinatorResults(std::vector<RuntimeCoordinatorServiceResult>& results);
|
||||
|
||||
private:
|
||||
std::unique_ptr<ControlServices> mControlServices;
|
||||
|
||||
Reference in New Issue
Block a user