MCPcopy Create free account
hub / github.com/LBANN/lbann / push

Method push

include/lbann/utils/threads/thread_safe_queue.hpp:70–85  ·  view source on GitHub ↗

@brief Adds a value to back of the queue */

Source from the content-addressed store, hash-verified

68
69 /** @brief Adds a value to back of the queue */
70 void push(T value)
71 {
72 // Make the new data outside of the lock to minimize lock time
73 auto new_value = std::make_unique<T>(std::move(value));
74 auto new_node = std::make_unique<_Node>();
75
76 // Adding to the queue only modifies the tail
77 {
78 std::lock_guard<std::mutex> lk(tail_mtx_);
79 tail_->data_ = std::move(new_value);
80 tail_->next_ = std::move(new_node);
81 tail_ = tail_->next_.get();
82 }
83 // Update the condition variable (for wait_and_pop)
84 data_available_.notify_one();
85 }
86
87 void wake_all(bool stop = false)
88 {

Callers 8

is_cyclicFunction · 0.80
breadth_first_searchFunction · 0.80
depth_first_searchFunction · 0.80
topological_sortFunction · 0.80
condensationFunction · 0.80
push_grid_Function · 0.80
submit_jobMethod · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected