5 // Created by Jens Alfke on 4/29/08.
6 // Copyright 2008 __MyCompanyName__. All rights reserved.
9 #import "MYCoroutine.h"
12 @interface CoroTest1 : MYCoroutine
19 @interface CoroTest2 : CoroTest1
23 CoroTest1 *firstCoro, *secondCoro;
26 @implementation CoroTest2
32 NSLog(@"secondTask created with value %d", self.value);
36 NSLog(@"secondTask: %d %d", self.bytesLeftOnStack, num++);
44 @implementation CoroTest1
52 NSLog(@"firstTask created with value %d", self.value);
53 secondCoro = [[CoroTest2 alloc] init];
54 secondCoro.name = @"second";
60 NSLog(@"firstTask: %d %d", self.bytesLeftOnStack, num++);
66 [[MYCoroutine mainCoroutine] resume];
74 NSAutoreleasePool *pool = [NSAutoreleasePool new];
76 NSLog(@"Starting test...");
77 //[[[NSThread alloc] init] start];
78 firstCoro = [[CoroTest1 alloc] init];
79 firstCoro.name = @"first";
83 NSLog(@"Returned from coroutines; exiting");