MCPcopy Create free account
hub / github.com/AutonomousFieldRoboticsLab/SVIn / popBlocking

Method popBlocking

pose_graph/include/utils/ThreadSafeQueue.h:325–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

323
324template <typename T>
325bool ThreadsafeQueue<T>::popBlocking(T& value) {
326 std::unique_lock<std::mutex> lk(mutex_);
327 // Wait until there is data in the queue or shutdown requested.
328 data_cond_.wait(lk, [this] { return !data_queue_.empty() || shutdown_; });
329 // Return false in case shutdown is requested.
330 if (shutdown_) return false;
331 value = std::move(*data_queue_.front());
332 data_queue_.pop();
333 lk.unlock(); // Unlock before notify.
334 data_cond_.notify_one();
335 return true;
336}
337
338template <typename T>
339std::shared_ptr<T> ThreadsafeQueue<T>::popBlocking() {

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected