| 226 | } |
| 227 | |
| 228 | void dag_node::wait() const |
| 229 | { |
| 230 | while (!_is_submitted); |
| 231 | if(_is_complete) |
| 232 | return; |
| 233 | |
| 234 | _event->wait(); |
| 235 | // All requirements are now also complete |
| 236 | descend_requirement_tree([](const dag_node* current) -> bool{ |
| 237 | // Descend to all nodes that are not yet marked as complete, |
| 238 | // so abort on nodes that are complete |
| 239 | if(current->_is_complete) |
| 240 | return false; |
| 241 | // Otherwise mark as complete and return |
| 242 | current->_is_complete = true; |
| 243 | return true; |
| 244 | }, this); |
| 245 | |
| 246 | _is_complete = true; |
| 247 | } |
| 248 | |
| 249 | std::shared_ptr<dag_node_event> |
| 250 | dag_node::get_event() const{ |