view tests/mini/fiber.d @ 1031:e594385d7e53

Fixed potential assertion failure in taking address of function as a constant expression.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Tue, 03 Mar 2009 17:27:14 +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();
}