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

Method return_item

benchmarks/tbb/pipeline.cpp:212–223  ·  view source on GitHub ↗

return an item, invalidate the queued item, but only advance if advance advance == true for parallel filters. If the filter is serial, leave the item in the buffer to keep another stage from being spawned.

Source from the content-addressed store, hash-verified

210 // advance == true for parallel filters. If the filter is serial, leave the
211 // item in the buffer to keep another stage from being spawned.
212 bool return_item(task_info& info, bool advance) {
213 spin_mutex::scoped_lock lock( array_mutex );
214 task_info& item = array[low_token&(array_size-1)];
215 ITT_NOTIFY( sync_acquired, this );
216 if( item.is_valid ) {
217 info = item;
218 item.is_valid = false;
219 if (advance) low_token++;
220 return true;
221 }
222 return false;
223 }
224
225 //! true if the current low_token is valid.
226 bool has_item() { spin_mutex::scoped_lock lock(array_mutex); return array[low_token&(array_size -1)].is_valid; }

Callers 3

executeMethod · 0.80
executeMethod · 0.80
internal_process_itemMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected