override */
| 1330 | #endif |
| 1331 | |
| 1332 | /* override */ bool register_successor( successor_type &s ) { |
| 1333 | spin_mutex::scoped_lock l( my_mutex ); |
| 1334 | task* tp = this->my_graph.root_task(); // just to test if we are resetting |
| 1335 | if (my_buffer_is_valid && tp) { |
| 1336 | // We have a valid value that must be forwarded immediately. |
| 1337 | if ( s.try_put( my_buffer ) || !s.register_predecessor( *this ) ) { |
| 1338 | // We add the successor: it accepted our put or it rejected it but won't let us become a predecessor |
| 1339 | my_successors.register_successor( s ); |
| 1340 | } else { |
| 1341 | // We don't add the successor: it rejected our put and we became its predecessor instead |
| 1342 | return false; |
| 1343 | } |
| 1344 | } else { |
| 1345 | // No valid value yet, just add as successor |
| 1346 | my_successors.register_successor( s ); |
| 1347 | } |
| 1348 | return true; |
| 1349 | } |
| 1350 | |
| 1351 | /* override */ bool remove_successor( successor_type &s ) { |
| 1352 | spin_mutex::scoped_lock l( my_mutex ); |
nothing calls this directly
no test coverage detected