Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/exceptions/cancel/coroutine.cfa

    r3bf9d10 rd00d581  
    11// Try cancelling a coroutine.
    22
    3 #include <fstream.hfa>
    43#include <coroutine.hfa>
    54
     
    1413
    1514void main(WillCancel & wc) {
    16         sout | '1';
     15        printf("1");
    1716        cancel_stack((internal_error){&internal_vt});
    18         sout | '!';
     17        printf("!");
    1918}
    2019
    2120int main(int argc, char * argv[]) {
    22         sout | nlOff;
    2321        WillCancel cancel;
    2422        try {
    25                 sout | '0';
     23                printf("0");
    2624                resume(cancel);
    27                 sout | '4';
     25                printf("4");
    2826        } catchResume (CoroutineCancelled(WillCancel) * error) {
    29                 sout | '2';
     27                printf("2");
    3028                if ((virtual internal_error *)error->the_exception) {
    31                         sout | '3';
     29                        printf("3");
    3230                }
    3331        }
    34         sout | '5' | nl;
     32        printf("5\n");
    3533}
Note: See TracChangeset for help on using the changeset viewer.