Changeset fc0996a for src/Concurrency


Ignore:
Timestamp:
Jun 1, 2023, 11:56:38 AM (13 months ago)
Author:
caparsons <caparson@…>
Branches:
ast-experimental, master
Children:
22f2b7d
Parents:
70a4ed5
Message:

refactores to account for removal of ret val from on_selected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Waituntil.cpp

    r70a4ed5 rfc0996a  
    9595                        case 0:
    9696                            try {
    97                                 if (on_selected( A, clause1 ))
     97                                    on_selected( A, clause1 );
    9898                                    doA();
    9999                            }
     
    122122        // the unregister and on_selected calls are needed to support primitives where the acquire has side effects
    123123        // 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 )
    125126            doA();
    126127        ... repeat if above for B and C ...
     
    619620
    620621// 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 ...
    622623*/
    623624CompoundStmt * GenerateWaitUntilCore::genStmtBlock( const WhenClause * clause, const ClauseData * data ) {
     
    625626    return new CompoundStmt( cLoc,
    626627        {
    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 )
    635632        }
    636633    );
     
    644641            case 0:
    645642                try {
    646                     if (on_selected( target1, clause1 ))
    647                         dotarget1stmt();
     643                    on_selected( target1, clause1 );
     644                    dotarget1stmt();
    648645                }
    649646                finally { clause_statuses[i] = __SELECT_RUN; unregister_select(target1, clause1); }
     
    664661        case 0:
    665662            try {
    666                 if (on_selected( target1, clause1 ))
    667                     dotarget1stmt();
     663                on_selected( target1, clause1 );
     664                dotarget1stmt();
    668665            }
    669666            finally { clause_statuses[i] = __SELECT_RUN; unregister_select(target1, clause1); }
     
    10201017                ifCond,
    10211018                genStmtBlock( stmt->clauses.at(idx), data.at(idx) ),
    1022                 // ast::deepCopy( stmt->clauses.at(idx)->stmt ),
    10231019                recursiveOrIfGen( stmt, data, idx + 1, elseWhenName )
    10241020            )
Note: See TracChangeset for help on using the changeset viewer.