Fix tests hanging in MultiQueueWaiter destructor.

std::condition_variable_any destructor is only safe to invoke if all
threads have been notified.

Reference:
https://en.cppreference.com/w/cpp/thread/condition_variable_any/%7Econdition_variable_any

Signed-off-by: Ernest Borowski <e.borowski.git@protonmail.com>
This commit is contained in:
Ernest Borowski 2020-07-27 00:48:45 +02:00
parent 4cf16a7e5a
commit ba34c2a75c
No known key found for this signature in database
GPG Key ID: 4ACA3E667585A409

View File

@ -46,6 +46,9 @@ private:
struct MultiQueueWaiter { struct MultiQueueWaiter {
std::condition_variable_any cv; std::condition_variable_any cv;
~MultiQueueWaiter() {
cv.notify_all();
}
static bool hasState(std::initializer_list<BaseThreadQueue *> queues) { static bool hasState(std::initializer_list<BaseThreadQueue *> queues) {
for (BaseThreadQueue *queue : queues) { for (BaseThreadQueue *queue : queues) {