Skip to content

Commit

Permalink
fix(queue): use proper wait_for overload
Browse files Browse the repository at this point in the history
  • Loading branch information
Curve committed Jan 25, 2024
1 parent 5125ce0 commit 9fe1d87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/cr/queue.inl
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ namespace cr
std::unique_lock lock(m_mutex);

assert(!(m_queue.empty() && senders == 0) && "No senders exist, try_pop will timeout");
auto status = m_cond.wait_for(lock, timeout, [this] { return !m_queue.empty(); });
auto success = m_cond.wait_for(lock, timeout, [this] { return !m_queue.empty(); });

if (status == std::cv_status::timeout)
if (!success)
{
return std::nullopt;
}
Expand Down

0 comments on commit 9fe1d87

Please sign in to comment.