| 230 | } |
| 231 | |
| 232 | BOOL WINAPI ConsoleDebugMockService::ConsoleHandler(DWORD signal) |
| 233 | { |
| 234 | if (signal == CTRL_C_EVENT || signal == CTRL_CLOSE_EVENT) { |
| 235 | Get().SignalServiceStop(); |
| 236 | if (signal == CTRL_CLOSE_EVENT) { |
| 237 | // give the main thread time to respond to the close signal |
| 238 | // exiting this handler to quickly often gets the process killed |
| 239 | // before it can shutdown gracefully |
| 240 | std::this_thread::sleep_for(1ms); |
| 241 | } |
| 242 | return TRUE; |
| 243 | } |
| 244 | return FALSE; |
| 245 | } |
| 246 | |
| 247 | ConsoleDebugMockService& ConsoleDebugMockService::Get() |
| 248 | { |
nothing calls this directly
no test coverage detected