view tests/mini/fiber.d @ 838:94ba810ea2b0

Fixed problem with nested function inside static nested function. see mini/compile_nested2.d. fixes #143 .
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Tue, 09 Dec 2008 14:57:01 +0100
parents 4ac97ec7c18e
children
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();
}