Changeset a4da45e for tests/exceptions


Ignore:
Timestamp:
Feb 26, 2024, 3:53:42 AM (2 years ago)
Author:
JiadaL <j82liang@…>
Branches:
master, stuck-waitfor-destruct
Children:
3f9a8d0
Parents:
0522ebe (diff), 022bce0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Resolve conflict

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/exceptions/pingpong_nonlocal.cfa

    r0522ebe ra4da45e  
    22#include <thread.hfa>
    33#include <mutex_stmt.hfa>
     4#include <Exception.hfa>
    45
    5 exception num_ping_pongs { int num; };
    6 vtable(num_ping_pongs) num_ping_pongs_vt;
     6ExceptionDecl( num_ping_pongs, int num; );
    77
    88thread Ping_Pong {
     
    1616        this.name = name;
    1717        cnt = 0;
    18         ?{}( except, &num_ping_pongs_vt, 0 );
     18        ?{}( except, ExceptionArgs( num_ping_pongs, 0 ) );
    1919}
    2020
     
    2929                for () {
    3030                        while( ! poll( this ) ) { yield(); }
    31             inc_resume_at( cnt );
     31                        inc_resume_at( cnt );
    3232                }
    3333        } catchResume( num_ping_pongs * e; e->num < numtimes ) {
     
    3737                mutex( sout ) sout | name | "catch" | cnt | e->num;
    3838                if ( e->num == numtimes ) {
    39             inc_resume_at( e->num );
     39                        inc_resume_at( e->num );
    4040                }
    4141        }
     
    4949                &ping.partner = &pong;                                                  // create cycle
    5050                &pong.partner = &ping;
    51                 num_ping_pongs except{ &num_ping_pongs_vt, 0 };
    52                 resumeAt( pong, except );
     51                resumeAt( pong, ExceptionInst( num_ping_pongs, 0 ) );
    5352        }
    5453        sout | "main end";
Note: See TracChangeset for help on using the changeset viewer.