view tests/mini/fiber.d @ 1443:b6aa03164436

Fix "garbage at end of line" errors on mingw...shouldn't affect linux/macosx
author Kelly Wilson <wilsonk cpsc.ucalgary.ca>
date Sun, 31 May 2009 09:10:33 -0600
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();
}