diff --git a/Live/src/main/cpp/safe_queue.h b/Live/src/main/cpp/safe_queue.h index 49a2615..ed90570 100644 --- a/Live/src/main/cpp/safe_queue.h +++ b/Live/src/main/cpp/safe_queue.h @@ -62,7 +62,9 @@ public: int ret = 0; #ifdef C11 unique_lock lk(mt); - cv.wait(lk,[this]{return !work || !q.empty();}); + if (!work) { + return ret; + } if (!q.empty()) { value = q.front(); q.pop();