| 573 | } |
| 574 | |
| 575 | bool WaitAndResetEvent(int timeoutMS) |
| 576 | { |
| 577 | while (true) |
| 578 | { |
| 579 | auto result = ::WaitForSingleObjectEx(mEvent, (DWORD)timeoutMS, TRUE); |
| 580 | if (result == STATUS_USER_APC) |
| 581 | continue; // Retry |
| 582 | if (result == WAIT_OBJECT_0) |
| 583 | { |
| 584 | ::ResetEvent(mEvent); |
| 585 | return true; |
| 586 | } |
| 587 | return false; |
| 588 | } |
| 589 | } |
| 590 | }; |
| 591 | |
| 592 | struct BfpFile |