mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 15:45:08 +00:00
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:
parent
4cf16a7e5a
commit
ba34c2a75c
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user