Changeset a4da45e for tests/exceptions
- Timestamp:
- Feb 26, 2024, 3:53:42 AM (2 years ago)
- 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. - File:
-
- 1 edited
-
tests/exceptions/pingpong_nonlocal.cfa (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/exceptions/pingpong_nonlocal.cfa
r0522ebe ra4da45e 2 2 #include <thread.hfa> 3 3 #include <mutex_stmt.hfa> 4 #include <Exception.hfa> 4 5 5 exception num_ping_pongs { int num; }; 6 vtable(num_ping_pongs) num_ping_pongs_vt; 6 ExceptionDecl( num_ping_pongs, int num; ); 7 7 8 8 thread Ping_Pong { … … 16 16 this.name = name; 17 17 cnt = 0; 18 ?{}( except, &num_ping_pongs_vt, 0);18 ?{}( except, ExceptionArgs( num_ping_pongs, 0 ) ); 19 19 } 20 20 … … 29 29 for () { 30 30 while( ! poll( this ) ) { yield(); } 31 inc_resume_at( cnt );31 inc_resume_at( cnt ); 32 32 } 33 33 } catchResume( num_ping_pongs * e; e->num < numtimes ) { … … 37 37 mutex( sout ) sout | name | "catch" | cnt | e->num; 38 38 if ( e->num == numtimes ) { 39 inc_resume_at( e->num );39 inc_resume_at( e->num ); 40 40 } 41 41 } … … 49 49 &ping.partner = &pong; // create cycle 50 50 &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 ) ); 53 52 } 54 53 sout | "main end";
Note:
See TracChangeset
for help on using the changeset viewer.