diff --git a/src/thread_base.cc b/src/thread_base.cc index c74fb3a8..1e6b9c57 100644 --- a/src/thread_base.cc +++ b/src/thread_base.cc @@ -13,7 +13,7 @@ #include "globals.h" -class lt_cacheline_aligned thread_queue_hack : private std::vector { +class thread_queue_hack : private std::vector { public: static constexpr unsigned int max_size = 32; @@ -28,16 +28,16 @@ public: } 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) + "."); const std::lock_guard lguard(m_lock); + if (base_type::size() >= max_size) + throw torrent::internal_error("Overflowed thread_queue max size of " + std::to_string(max_size) + "."); base_type::push_back(v); } void copy_and_clear(base_type& target) { std::lock_guard lguard(m_lock); target.assign(begin(), end()); - clear(); + base_type::clear(); } private: