1 auto rootFiber = new TestFiber(0); 2 rootFiber.call(); 3 4 // foreach (immutable i; 0 .. maxFiberCount) 5 // { 6 // // create instances of each type 7 // auto derived = new TestFiber(i); 8 // // Fiber composed = new Fiber(&fiberFunc, i); 9 10 // // call both fibers once 11 // derived.call(); 12 // // composed.call(); 13 // // printf("Execution returned to calling context.\n"); 14 // // composed.call(); 15 16 // // since each fiber has run to completion, each should have state TERM 17 // assert(derived.state == Fiber.State.TERM); 18 // // assert(composed.state == Fiber.State.TERM); 19 // }
Function-like fiber.
Arguments must all fulfill isFiberParameter.