| 176 | // of the current token in the buffer keeps another stage from being spawned. |
| 177 | template<typename StageTask> |
| 178 | void note_done( Token token, StageTask& spawner ) { |
| 179 | task_info wakee; |
| 180 | wakee.reset(); |
| 181 | { |
| 182 | spin_mutex::scoped_lock lock( array_mutex ); |
| 183 | if( !is_ordered || token==low_token ) { |
| 184 | // Wake the next task |
| 185 | task_info& item = array[++low_token & (array_size-1)]; |
| 186 | ITT_NOTIFY( sync_acquired, this ); |
| 187 | wakee = item; |
| 188 | item.is_valid = false; |
| 189 | } |
| 190 | } |
| 191 | if( wakee.is_valid ) |
| 192 | spawner.spawn_stage_task(wakee); |
| 193 | } |
| 194 | |
| 195 | #if __TBB_TASK_GROUP_CONTEXT |
| 196 | //! The method destroys all data in filters to prevent memory leaks |
no test coverage detected