MCPcopy Create free account
hub / github.com/apache/impala / PushFront

Method PushFront

be/src/util/internal-queue.h:114–128  ·  view source on GitHub ↗

Pushes the node onto the queue's head. This is O(1).

Source from the content-addressed store, hash-verified

112
113 /// Pushes the node onto the queue's head. This is O(1).
114 void PushFront(T* n) {
115 Node* node = (Node*)n;
116 DCHECK(node->next == nullptr);
117 DCHECK(node->prev == nullptr);
118 DCHECK(node->parent_queue == nullptr);
119 node->parent_queue = this;
120 {
121 std::lock_guard<LockType> lock(lock_);
122 if (head_ != nullptr) head_->prev = node;
123 node->next = head_;
124 head_ = node;
125 if (tail_ == nullptr) tail_ = node;
126 ++size_;
127 }
128 }
129
130 /// Dequeues an element from the queue's head. Returns nullptr if the queue
131 /// is empty. This is O(1).

Callers 2

AddRangeToDiskMethod · 0.80
TESTFunction · 0.80

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.64