MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / enqueue

Method enqueue

benchmarks/dlib/queue/queue_kernel_1.h:234–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232 typename mem_manager
233 >
234 void queue_kernel_1<T,mem_manager>::
235 enqueue (
236 T& item
237 )
238 {
239 // make new node
240 node* temp = new node;
241
242 // swap item into new node
243 exchange(item,temp->item);
244
245 if (queue_size == 0)
246 out = temp;
247 else
248 in->last = temp;
249
250 // make in point to the new node
251 in = temp;
252
253 ++queue_size;
254
255 // put the enumerator at the start
256 reset();
257 }
258
259// ----------------------------------------------------------------------------------------
260

Callers

nothing calls this directly

Calls 1

exchangeFunction · 0.85

Tested by

no test coverage detected