Ignore:
Timestamp:
Jul 11, 2023, 2:27:58 PM (12 months ago)
Author:
caparsons <caparson@…>
Branches:
master
Children:
bbecdd4
Parents:
4c8ce47
Message:

fixed spurious channel close waituntil error case. Was caused by a race condition causing an exception to be thrown while another was in flight

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Waituntil.cpp

    r4c8ce47 rb93bf85  
    12901290    // Collection of unregister calls on resources to be put in finally clause
    12911291    // for each clause:
    1292     // when_cond_i = (!__CFA_has_clause_run( clause_statuses[i] )) && unregister_select( ... , clausei );
     1292    // if ( !__CFA_has_clause_run( clause_statuses[i] )) && unregister_select( ... , clausei ) ) { ... clausei stmt ... }
    12931293    // OR if when( ... ) defined on resource
    1294     // if ( when_cond_i )
    1295     //   when_cond_i =  (!__CFA_has_clause_run( clause_statuses[i] )) && unregister_select( ... , clausei );
     1294    // if ( when_cond_i && (!__CFA_has_clause_run( clause_statuses[i] )) && unregister_select( ... , clausei ) ) { ... clausei stmt ... }
    12961295    CompoundStmt * unregisters = new CompoundStmt( loc );
    1297 
    12981296
    12991297    Expr * statusExpr; // !__CFA_has_clause_run( clause_statuses[i] )
     
    13481346            new IfStmt( cLoc,
    13491347                statusExpr,
    1350                 genStmtBlock( stmt->clauses.at(i), clauseData.at(i) )
    1351             )
    1352         );
     1348                new CompoundStmt( cLoc,
     1349                    {
     1350                        new IfStmt( cLoc,
     1351                            genSelectTraitCall( stmt->clauses.at(i), clauseData.at(i), "on_selected" ),
     1352                            ast::deepCopy( stmt->clauses.at(i)->stmt )
     1353                        )
     1354                    }
     1355                )
     1356            )
     1357        );
     1358
     1359        // // generates:
     1360        // // if ( statusExpr ) { ... clausei stmt ... }
     1361        // unregisters->push_back(
     1362        //     new IfStmt( cLoc,
     1363        //         statusExpr,
     1364        //         genStmtBlock( stmt->clauses.at(i), clauseData.at(i) )
     1365        //     )
     1366        // );
    13531367    }
    13541368
Note: See TracChangeset for help on using the changeset viewer.