diff --git a/src/thread_base.cc b/src/thread_base.cc index 6564133a..c74fb3a8 100644 --- a/src/thread_base.cc +++ b/src/thread_base.cc @@ -20,10 +20,13 @@ public: using value_type = ThreadBase::thread_base_func; using base_type = std::vector; - using base_type::empty; - thread_queue_hack() { reserve(max_size); }; + bool empty() { + std::lock_guard lguard(m_lock); + return base_type::empty(); + } + void push_back(value_type v) { if (size() >= max_size) throw torrent::internal_error("Overflowed thread_queue max size of " + std::to_string(max_size) + ".");