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

Function ProducerThread

be/src/util/internal-queue-test.cc:156–167  ·  view source on GitHub ↗

CHECK() is not thread safe so return the result in *failed.

Source from the content-addressed store, hash-verified

154
155// CHECK() is not thread safe so return the result in *failed.
156void ProducerThread(InternalQueue<IntNode>* queue, int num_inserts,
157 vector<IntNode>* nodes, AtomicInt32* counter, bool* failed) {
158 for (int i = 0; i < num_inserts && !*failed; ++i) {
159 // Get the next index to queue.
160 int32_t value = counter->Add(1) - 1;
161 nodes->at(value).value = value;
162 queue->Enqueue(&nodes->at(value));
163 if (i % VALIDATE_INTERVAL == 0) {
164 if (!queue->Validate()) *failed = true;
165 }
166 }
167}
168
169void ConsumerThread(InternalQueue<IntNode>* queue, int num_consumes, int delta,
170 vector<int>* results, bool* failed) {

Callers 1

TESTFunction · 0.70

Calls 3

AddMethod · 0.45
EnqueueMethod · 0.45
ValidateMethod · 0.45

Tested by

no test coverage detected