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(