mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 20:13:36 +00:00
Ensure MessageQueue wait time calculations always use the same time
unit!
This commit is contained in:
parent
0fdb83d643
commit
c8b81162f3
@ -56,8 +56,11 @@ void MessageQueue::WaitAndDispatch(int64_t timeoutMillis) {
|
||||
this->queue.front()->time -
|
||||
system_clock::now().time_since_epoch());
|
||||
|
||||
if (timeoutMillis >= 0 && waitTime.count() > timeoutMillis) {
|
||||
waitTime = milliseconds(timeoutMillis);
|
||||
if (timeoutMillis >= 0) {
|
||||
auto timeoutDuration = milliseconds(timeoutMillis);
|
||||
if (waitTime > timeoutDuration) {
|
||||
waitTime = timeoutDuration;
|
||||
}
|
||||
}
|
||||
|
||||
if (waitTime.count() > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user