Mercurial > projects > ldc
view tests/mini/fiber.d @ 640:c2a342b5d8e5
Made Fibers work with LLVMDC on x86 Posix.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Fri, 03 Oct 2008 00:42:17 +0200 |
parents | |
children | 4ac97ec7c18e |
line wrap: on
line source
private import tango.core.Thread; extern(C) void printf(char*, ...); void foo() { printf("-- I am here\n"); Fiber.yield(); printf("-- Now I am here\n"); } void main() { Fiber f = new Fiber(&foo); printf("Running f once\n"); f.call(); printf("Running f again\n"); f.call(); }