From: Stephen Seo Date: Thu, 24 Oct 2019 08:51:40 +0000 (+0900) Subject: Add missing impl fn to TSLQueue X-Git-Tag: 1.0~139 X-Git-Url: https://git.seodisparate.com/stephenseo/server_config?a=commitdiff_plain;h=ebedd06fdb39a2ddc47622c9ab124fbcd2c4c7bb;p=UDPConnection Add missing impl fn to TSLQueue --- 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(