bool get_element(void) { int data; bool success = sf.pop(data); if (success) { ++received_nodes; --spsc_queue_cnt; bool erased = working_set.erase(data); assert(erased); return true; } else return false; }
bool get_elements(void) { boost::array<int, buf_size> output_buffer; size_t popd = sf.pop(output_buffer.c_array(), output_buffer.size()); if (popd) { received_nodes += popd; spsc_queue_cnt -= popd; for (size_t i = 0; i != popd; ++i) { bool erased = working_set.erase(output_buffer[i]); assert(erased); } return true; } else return false; }