Mercurial > projects > ldc
comparison 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 |
comparison
equal
deleted
inserted
replaced
639:8aebdf56c455 | 640:c2a342b5d8e5 |
---|---|
1 private import | |
2 tango.core.Thread; | |
3 | |
4 extern(C) void printf(char*, ...); | |
5 | |
6 void foo() | |
7 { | |
8 printf("-- I am here\n"); | |
9 Fiber.yield(); | |
10 printf("-- Now I am here\n"); | |
11 } | |
12 | |
13 void main() | |
14 { | |
15 Fiber f = new Fiber(&foo); | |
16 | |
17 printf("Running f once\n"); | |
18 f.call(); | |
19 printf("Running f again\n"); | |
20 f.call(); | |
21 } |