Przeglądaj źródła

Support shutdown with postLimit in BlockingQueue

Adam Ierymenko 6 lat temu
rodzic
commit
690bd933d5
1 zmienionych plików z 3 dodań i 0 usunięć
  1. 3 0
      osdep/BlockingQueue.hpp

+ 3 - 0
osdep/BlockingQueue.hpp

@@ -63,6 +63,8 @@ public:
 				c.notify_one();
 				break;
 			}
+			if (!r)
+				break;
 			gc.wait(lock);
 		}
 	}
@@ -72,6 +74,7 @@ public:
 		std::lock_guard<std::mutex> lock(m);
 		r = false;
 		c.notify_all();
+		gc.notify_all();
 	}
 
 	inline bool get(T &value)