| 457 | |
| 458 | |
| 459 | void EtwReaderStopAll() { |
| 460 | // Signal stop |
| 461 | if (hStopEventEtw != NULL) { |
| 462 | SetEvent(hStopEventEtw); |
| 463 | } |
| 464 | |
| 465 | trace_user.stop(); |
| 466 | |
| 467 | // Wait for thread to exit cleanly |
| 468 | if (hEtwThreadHandle != NULL) { |
| 469 | if (WaitForSingleObject(hEtwThreadHandle, 5000) == WAIT_TIMEOUT) { |
| 470 | LOG_A(LOG_WARNING, "ETW: Thread did not exit in time, force-terminating"); |
| 471 | TerminateThread(hEtwThreadHandle, 1); |
| 472 | } |
| 473 | CloseHandle(hEtwThreadHandle); |
| 474 | hEtwThreadHandle = NULL; |
| 475 | } |
| 476 | |
| 477 | // Clean up event handles |
| 478 | if (hStopEventEtw != NULL) { |
| 479 | CloseHandle(hStopEventEtw); |
| 480 | hStopEventEtw = NULL; |
| 481 | } |
| 482 | if (threadReadynessEtw != NULL) { |
| 483 | CloseHandle(threadReadynessEtw); |
| 484 | threadReadynessEtw = NULL; |
| 485 | } |
| 486 | } |
no test coverage detected