| 313 | |
| 314 | |
| 315 | void StopEventProcessor() { |
| 316 | // Signal stop |
| 317 | if (hStopEventProcessor != NULL) { |
| 318 | SetEvent(hStopEventProcessor); |
| 319 | } |
| 320 | |
| 321 | if (EventProcessor_thread != NULL) { |
| 322 | g_EventAggregator.Stop(); |
| 323 | |
| 324 | if (WaitForSingleObject(EventProcessor_thread, 5000) == WAIT_TIMEOUT) { |
| 325 | LOG_A(LOG_WARNING, "EventProcessor: Thread did not exit in time, force-terminating"); |
| 326 | TerminateThread(EventProcessor_thread, 1); |
| 327 | } |
| 328 | // handle ownership stays with the threads vector; do not close here |
| 329 | } |
| 330 | |
| 331 | if (hStopEventProcessor != NULL) { |
| 332 | CloseHandle(hStopEventProcessor); |
| 333 | hStopEventProcessor = NULL; |
| 334 | } |
| 335 | } |
| 336 |
no test coverage detected