Fix mingw32 compilation

pull/1228/head
gabime 6 years ago
parent 35835469d7
commit e771f4e75e

@ -70,7 +70,7 @@ public:
// apparently mingw deadlocks if the mutex is released before cv.notify_one(),
// so release the mutex at the very end each function.
// try to enqueue and block if no room left
// try to enqueue and block if no room left
void enqueue(T &&item)
{
std::unique_lock<std::mutex> lock(queue_mutex_);
@ -85,6 +85,7 @@ public:
std::unique_lock<std::mutex> lock(queue_mutex_);
q_.push_back(std::move(item));
push_cv_.notify_one();
}
// try to dequeue item. if no item found. wait upto timeout and try again
@ -96,7 +97,8 @@ public:
{
return false;
}
q_.pop_front(popped_item);
popped_item = std::move(q_.front());
q_.pop_front();
pop_cv_.notify_one();
return true;
}

Loading…
Cancel
Save