File:  [RetroPC.NET] / np2 / x11 / taskmng.c
Revision 1.4: download - view: text, annotated - select for diffs
Wed Jan 24 01:01:00 2007 JST (18 years, 9 months ago) by monaka
Branches: MAIN
CVS tags: HEAD
taskmng_sleep(): calc sleep time.

#include "compiler.h"

#include "np2.h"
#include "toolkit.h"

#include "taskmng.h"


void
taskmng_initialize(void)
{

	np2running = 1;
}

BOOL
taskmng_sleep(UINT32 tick)
{
	UINT32 base;
	UINT32 now;

	base = GETTICK();
	while (taskmng_isavail() && (((now = GETTICK()) - base) < tick)) {
		toolkit_event_process();
		usleep(tick - (now - base) / 2);
	}
	return taskmng_isavail();
}

void
taskmng_exit(void)
{

	np2running = 0;
}

RetroPC.NET-CVS <cvs@retropc.net>