MCPcopy Create free account
hub / github.com/cameron314/readerwriterqueue / try_dequeue

Method try_dequeue

benchmarks/ext/1024cores/spscqueue.h:78–90  ·  view source on GitHub ↗

returns 'false' if queue is empty

Source from the content-addressed store, hash-verified

76
77 // returns 'false' if queue is empty
78 bool try_dequeue(T& v)
79 {
80 if (load_consume(&tail_->next_))
81 {
82 v = tail_->next_->value_;
83 store_release(&tail_, tail_->next_);
84 return true;
85 }
86 else
87 {
88 return false;
89 }
90 }
91
92private:
93 // internal node structure

Callers 1

runBenchmarkFunction · 0.45

Calls 2

load_consumeFunction · 0.85
store_releaseFunction · 0.85

Tested by

no test coverage detected