- File:
-
- 1 edited
-
tests/exceptions/cancel/coroutine.cfa (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/exceptions/cancel/coroutine.cfa
r3bf9d10 rd00d581 1 1 // Try cancelling a coroutine. 2 2 3 #include <fstream.hfa>4 3 #include <coroutine.hfa> 5 4 … … 14 13 15 14 void main(WillCancel & wc) { 16 sout | '1';15 printf("1"); 17 16 cancel_stack((internal_error){&internal_vt}); 18 sout | '!';17 printf("!"); 19 18 } 20 19 21 20 int main(int argc, char * argv[]) { 22 sout | nlOff;23 21 WillCancel cancel; 24 22 try { 25 sout | '0';23 printf("0"); 26 24 resume(cancel); 27 sout | '4';25 printf("4"); 28 26 } catchResume (CoroutineCancelled(WillCancel) * error) { 29 sout | '2';27 printf("2"); 30 28 if ((virtual internal_error *)error->the_exception) { 31 sout | '3';29 printf("3"); 32 30 } 33 31 } 34 sout | '5' | nl;32 printf("5\n"); 35 33 }
Note:
See TracChangeset
for help on using the changeset viewer.