Ignore:
File:
1 edited

Legend:

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

    r3bf9d10 rd00d581  
    11// Try cancelling a thread.
    22
    3 #include <fstream.hfa>
    43#include <thread.hfa>
    54
     
    1413
    1514void main(WillCancel &) {
    16         sout | '1';
     15        printf("1");
    1716        cancel_stack((internal_error){&internal_vt});
    18         sout | '!';
     17        printf("!");
    1918}
    2019
    2120void explicit() {
    2221        try {
    23                 sout | '0';
     22                printf("0");
    2423                WillCancel cancel;
    25                 sout | '1';
     24                printf("1");
    2625                join(cancel);
    27                 sout | '4';
     26                printf("4");
    2827        } catchResume (ThreadCancelled(WillCancel) * error) {
    29                 sout | '2';
     28                printf("2");
    3029                if ((virtual internal_error *)error->the_exception) {
    31                         sout | '3';
     30                        printf("3");
    3231                }
    3332        }
    34         sout | '5' | nl;
     33        printf("5\n");
    3534}
    3635
     
    3837        try {
    3938                {
    40                         sout | '0';
     39                        printf("0");
    4140                        WillCancel cancel;
    42                         sout | '1';
     41                        printf("1");
    4342                }
    44                 sout | '4';
     43                printf("4");
    4544        } catchResume (ThreadCancelled(WillCancel) * error) {
    46                 sout | '2';
     45                printf("2");
    4746                if ((virtual internal_error *)error->the_exception) {
    48                         sout | '3';
     47                        printf("3");
    4948                }
    5049        }
    51         sout | '5' | nl;
     50        printf("5\n");
    5251}
    5352
    5453int main(int argc, char * argv[]) {
    55         sout | nlOff;
    5654        explicit();
    5755        implicit();
Note: See TracChangeset for help on using the changeset viewer.