view tests/mini/fiber.d @ 850:5f5e6eb790e7

Automated merge with http://hg.dsource.org/projects/ldc
author Christian Kamm <kamm incasoftware de>
date Sun, 14 Dec 2008 16:30:20 +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();
}