Instance: rename Shutdown() to Break()
This commit is contained in:
parent
b6013a92e0
commit
befd669075
|
@ -97,9 +97,9 @@ struct Instance final
|
||||||
~Instance() noexcept;
|
~Instance() noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initiate shutdown. Wrapper for EventLoop::Break().
|
* Wrapper for EventLoop::Break(). Call to initiate shutdown.
|
||||||
*/
|
*/
|
||||||
void Shutdown() {
|
void Break() {
|
||||||
event_loop.Break();
|
event_loop.Break();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -747,7 +747,7 @@ JNIEXPORT void JNICALL
|
||||||
Java_org_musicpd_Bridge_shutdown(JNIEnv *, jclass)
|
Java_org_musicpd_Bridge_shutdown(JNIEnv *, jclass)
|
||||||
{
|
{
|
||||||
if (instance != nullptr)
|
if (instance != nullptr)
|
||||||
instance->Shutdown();
|
instance->Break();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -52,7 +52,7 @@ Client::OnSocketInput(void *data, size_t length) noexcept
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CommandResult::KILL:
|
case CommandResult::KILL:
|
||||||
partition->instance.Shutdown();
|
partition->instance.Break();
|
||||||
Close();
|
Close();
|
||||||
return InputResult::CLOSED;
|
return InputResult::CLOSED;
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ service_dispatcher(gcc_unused DWORD control, gcc_unused DWORD event_type,
|
||||||
switch (control) {
|
switch (control) {
|
||||||
case SERVICE_CONTROL_SHUTDOWN:
|
case SERVICE_CONTROL_SHUTDOWN:
|
||||||
case SERVICE_CONTROL_STOP:
|
case SERVICE_CONTROL_STOP:
|
||||||
instance->Shutdown();
|
instance->Break();
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
default:
|
default:
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
|
@ -107,7 +107,7 @@ console_handler(DWORD event)
|
||||||
// regardless our thread is still active.
|
// regardless our thread is still active.
|
||||||
// If this did not happen within 3 seconds
|
// If this did not happen within 3 seconds
|
||||||
// let's shutdown anyway.
|
// let's shutdown anyway.
|
||||||
instance->Shutdown();
|
instance->Break();
|
||||||
// Under debugger it's better to wait indefinitely
|
// Under debugger it's better to wait indefinitely
|
||||||
// to allow debugging of shutdown code.
|
// to allow debugging of shutdown code.
|
||||||
Sleep(IsDebuggerPresent() ? INFINITE : 3000);
|
Sleep(IsDebuggerPresent() ? INFINITE : 3000);
|
||||||
|
|
Loading…
Reference in New Issue