Changeset fc0996a
- Timestamp:
- Jun 1, 2023, 11:56:38 AM (18 months ago)
- Branches:
- ast-experimental, master
- Children:
- 22f2b7d
- Parents:
- 70a4ed5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Concurrency/Waituntil.cpp
r70a4ed5 rfc0996a 95 95 case 0: 96 96 try { 97 if (on_selected( A, clause1 ))97 on_selected( A, clause1 ); 98 98 doA(); 99 99 } … … 122 122 // the unregister and on_selected calls are needed to support primitives where the acquire has side effects 123 123 // so the corresponding block MUST be run for those primitives to not lose state (example is channels) 124 if ( ! has_run(clause_statuses[0]) && whenA && unregister_select(A, clause1) && on_selected( A, clause1 ) ) 124 if ( !has_run(clause_statuses[0]) && whenA && unregister_select(A, clause1) ) 125 on_selected( A, clause1 ) 125 126 doA(); 126 127 ... repeat if above for B and C ... … … 619 620 620 621 // Generates: 621 /* if ( on_selected( target_1, node_1 ))... corresponding body of target_1 ...622 /* on_selected( target_1, node_1 ); ... corresponding body of target_1 ... 622 623 */ 623 624 CompoundStmt * GenerateWaitUntilCore::genStmtBlock( const WhenClause * clause, const ClauseData * data ) { … … 625 626 return new CompoundStmt( cLoc, 626 627 { 627 new IfStmt( cLoc, 628 genSelectTraitCall( clause, data, "on_selected" ), 629 new CompoundStmt( cLoc, 630 { 631 ast::deepCopy( clause->stmt ) 632 } 633 ) 634 ) 628 new ExprStmt( cLoc, 629 genSelectTraitCall( clause, data, "on_selected" ) 630 ), 631 ast::deepCopy( clause->stmt ) 635 632 } 636 633 ); … … 644 641 case 0: 645 642 try { 646 if (on_selected( target1, clause1 ))647 643 on_selected( target1, clause1 ); 644 dotarget1stmt(); 648 645 } 649 646 finally { clause_statuses[i] = __SELECT_RUN; unregister_select(target1, clause1); } … … 664 661 case 0: 665 662 try { 666 if (on_selected( target1, clause1 ))667 663 on_selected( target1, clause1 ); 664 dotarget1stmt(); 668 665 } 669 666 finally { clause_statuses[i] = __SELECT_RUN; unregister_select(target1, clause1); } … … 1020 1017 ifCond, 1021 1018 genStmtBlock( stmt->clauses.at(idx), data.at(idx) ), 1022 // ast::deepCopy( stmt->clauses.at(idx)->stmt ),1023 1019 recursiveOrIfGen( stmt, data, idx + 1, elseWhenName ) 1024 1020 )
Note: See TracChangeset
for help on using the changeset viewer.