win32/WinEvent: add default value to Wait()
This commit is contained in:
parent
2011a6e2ee
commit
637cf8a039
@ -155,7 +155,7 @@ public:
|
|||||||
void Finish() noexcept { return SetStatus(Status::FINISH); }
|
void Finish() noexcept { return SetStatus(Status::FINISH); }
|
||||||
void Play() noexcept { return SetStatus(Status::PLAY); }
|
void Play() noexcept { return SetStatus(Status::PLAY); }
|
||||||
void Pause() noexcept { return SetStatus(Status::PAUSE); }
|
void Pause() noexcept { return SetStatus(Status::PAUSE); }
|
||||||
void WaitDataPoped() noexcept { data_poped.Wait(INFINITE); }
|
void WaitDataPoped() noexcept { data_poped.Wait(); }
|
||||||
void CheckException() {
|
void CheckException() {
|
||||||
if (error.occur.load()) {
|
if (error.occur.load()) {
|
||||||
auto err = std::exchange(error.ptr, nullptr);
|
auto err = std::exchange(error.ptr, nullptr);
|
||||||
@ -269,7 +269,7 @@ void WasapiOutputThread::Work() noexcept {
|
|||||||
COM com{true};
|
COM com{true};
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
event.Wait(INFINITE);
|
event.Wait();
|
||||||
|
|
||||||
Status current_state = status.load();
|
Status current_state = status.load();
|
||||||
if (current_state == Status::FINISH) {
|
if (current_state == Status::FINISH) {
|
||||||
@ -322,7 +322,7 @@ void WasapiOutputThread::Work() noexcept {
|
|||||||
} catch (...) {
|
} catch (...) {
|
||||||
error.ptr = std::current_exception();
|
error.ptr = std::current_exception();
|
||||||
error.occur.store(true);
|
error.occur.store(true);
|
||||||
error.thrown.Wait(INFINITE);
|
error.thrown.Wait();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ public:
|
|||||||
|
|
||||||
HANDLE handle() noexcept { return event; }
|
HANDLE handle() noexcept { return event; }
|
||||||
|
|
||||||
DWORD Wait(DWORD milliseconds) noexcept {
|
DWORD Wait(DWORD milliseconds=INFINITE) noexcept {
|
||||||
return WaitForSingleObject(event, milliseconds);
|
return WaitForSingleObject(event, milliseconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user