diff options
author | Chris Robinson <[email protected]> | 2020-08-12 10:00:43 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-08-12 10:00:43 -0700 |
commit | b12cd77d328350433a3d126d671cd8110cc9a21d (patch) | |
tree | f239f6aaf7c6f654dc43ada46e70a175748f232d | |
parent | ed1135f7aea649bf3f17c88bc8510e30a61bed5c (diff) |
Use a wait predicate instead of a while loop
-rw-r--r-- | alc/backends/wasapi.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp index 3b209e26..02e2a28e 100644 --- a/alc/backends/wasapi.cpp +++ b/alc/backends/wasapi.cpp @@ -495,8 +495,7 @@ struct WasapiProxy { static bool popMessage(Msg &msg) { std::unique_lock<std::mutex> lock{mMsgQueueLock}; - while(mMsgQueue.empty()) - mMsgQueueCond.wait(lock); + mMsgQueueCond.wait(lock, []{return !mMsgQueue.empty();}); msg = std::move(mMsgQueue.front()); mMsgQueue.pop_front(); return msg.mType != MsgType::QuitThread; |