Once again, this should have been included in a previous commit, RE renaming compnent state changed events
This commit is contained in:
@@ -14,7 +14,7 @@ void DebugServer::run() {
|
||||
|
||||
Logger::info("DebugServer ready");
|
||||
|
||||
while (this->getState() == ThreadState::READY) {
|
||||
while (this->getThreadState() == ThreadState::READY) {
|
||||
this->serve();
|
||||
this->eventListener->dispatchCurrentEvents();
|
||||
}
|
||||
@@ -41,21 +41,21 @@ void DebugServer::startup() {
|
||||
);
|
||||
|
||||
this->init();
|
||||
this->setStateAndEmitEvent(ThreadState::READY);
|
||||
this->setThreadStateAndEmitEvent(ThreadState::READY);
|
||||
}
|
||||
|
||||
void DebugServer::shutdown() {
|
||||
if (this->getState() == ThreadState::STOPPED || this->getState() == ThreadState::SHUTDOWN_INITIATED) {
|
||||
if (this->getThreadState() == ThreadState::STOPPED || this->getThreadState() == ThreadState::SHUTDOWN_INITIATED) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->setState(ThreadState::SHUTDOWN_INITIATED);
|
||||
this->setThreadState(ThreadState::SHUTDOWN_INITIATED);
|
||||
Logger::info("Shutting down DebugServer");
|
||||
this->close();
|
||||
this->interruptEventNotifier->close();
|
||||
this->setStateAndEmitEvent(ThreadState::STOPPED);
|
||||
this->setThreadStateAndEmitEvent(ThreadState::STOPPED);
|
||||
}
|
||||
|
||||
void DebugServer::onShutdownDebugServerEvent(EventPointer<Events::ShutdownDebugServer> event) {
|
||||
this->shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,12 +47,12 @@ namespace Bloom::DebugServers
|
||||
* @param state
|
||||
* @param emitEvent
|
||||
*/
|
||||
void setStateAndEmitEvent(ThreadState state) {
|
||||
Thread::setState(state);
|
||||
void setThreadStateAndEmitEvent(ThreadState state) {
|
||||
Thread::setThreadState(state);
|
||||
this->eventManager.triggerEvent(
|
||||
std::make_shared<Events::DebugServerThreadStateChanged>(state)
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles a shutdown request.
|
||||
|
||||
Reference in New Issue
Block a user