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.
| 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; } |
no outgoing calls
no test coverage detected