From ebedd06fdb39a2ddc47622c9ab124fbcd2c4c7bb Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Thu, 24 Oct 2019 17:51:40 +0900 Subject: [PATCH] Add missing impl fn to TSLQueue --- cpp_impl/src/TSLQueue.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cpp_impl/src/TSLQueue.hpp b/cpp_impl/src/TSLQueue.hpp index fd42df8..c4fafe9 100644 --- a/cpp_impl/src/TSLQueue.hpp +++ b/cpp_impl/src/TSLQueue.hpp @@ -222,6 +222,15 @@ void TSLQueue::clear() { iterWrapperCount = std::make_shared(); } +template +bool TSLQueue::empty() { + while(iterWrapperCount.use_count() > 1) { + std::this_thread::sleep_for(std::chrono::milliseconds(10)); + } + std::lock_guard lock(mutex); + return container.empty(); +} + template template TSLQueue::TSLQIterWrapper::TSLQIterWrapper( -- 2.49.0