- File:
-
- 1 edited
-
tests/exceptions/cancel/thread.cfa (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/exceptions/cancel/thread.cfa
r3bf9d10 rd00d581 1 1 // Try cancelling a thread. 2 2 3 #include <fstream.hfa>4 3 #include <thread.hfa> 5 4 … … 14 13 15 14 void main(WillCancel &) { 16 sout | '1';15 printf("1"); 17 16 cancel_stack((internal_error){&internal_vt}); 18 sout | '!';17 printf("!"); 19 18 } 20 19 21 20 void explicit() { 22 21 try { 23 sout | '0';22 printf("0"); 24 23 WillCancel cancel; 25 sout | '1';24 printf("1"); 26 25 join(cancel); 27 sout | '4';26 printf("4"); 28 27 } catchResume (ThreadCancelled(WillCancel) * error) { 29 sout | '2';28 printf("2"); 30 29 if ((virtual internal_error *)error->the_exception) { 31 sout | '3';30 printf("3"); 32 31 } 33 32 } 34 sout | '5' | nl;33 printf("5\n"); 35 34 } 36 35 … … 38 37 try { 39 38 { 40 sout | '0';39 printf("0"); 41 40 WillCancel cancel; 42 sout | '1';41 printf("1"); 43 42 } 44 sout | '4';43 printf("4"); 45 44 } catchResume (ThreadCancelled(WillCancel) * error) { 46 sout | '2';45 printf("2"); 47 46 if ((virtual internal_error *)error->the_exception) { 48 sout | '3';47 printf("3"); 49 48 } 50 49 } 51 sout | '5' | nl;50 printf("5\n"); 52 51 } 53 52 54 53 int main(int argc, char * argv[]) { 55 sout | nlOff;56 54 explicit(); 57 55 implicit();
Note:
See TracChangeset
for help on using the changeset viewer.