Exemple #1
0
void non_blocking_sleep(const double Seconds)
{
	bool done = false;

	Glib::signal_timeout().connect(
		sigc::bind(sigc::ptr_fun(detail::sleep_callback), &done), static_cast<unsigned long>(1000 * Seconds));

	while(!done)
		handle_pending_events();
}
Exemple #2
0
/**
 * This function handles all isokernel calls
 */
void ISOKRNLCALL(void)
{
	assert(pWorkspace != NULL && pCode != NULL);

	PRINT1("%s: isocall.\n", __func__);

	handle_pending_events();

	/* handle all commands */
	isostatus = 0;

	/* check if size of workspace must be set to default_ramtop */
	if (pUIWorkspace[mm_ProcessRAMtop] < IParagraph->default_ramtop) {
		pUIWorkspace[mm_ProcessRAMtop] = IParagraph->default_ramtop;
	}

	/* check if the workspace needs to be resized */
	if (current_ramtop != pUIWorkspace[mm_ProcessRAMtop]) {
		unit *new_workspace;

		/* resize the workspace */
		if ((new_workspace =
		     (unit *) realloc((void *) pWorkspace,
				      pUIWorkspace[mm_ProcessRAMtop] *
				      sizeof(unit)))) {
			pWorkspace = new_workspace;
			pUIWorkspace = &pWorkspace[IParagraph->app_ws_size];
			current_ramtop = pUIWorkspace[mm_ProcessRAMtop];
			lino_display_set_origin(&pWorkspace
						[pUIWorkspace
						 [mm_DisplayOrigin]]);
			/* clear the new bytes if any */
			if (pUIWorkspace[mm_ProcessRAMtop] > current_ramtop) {
				memset(&pWorkspace[current_ramtop], 0,
				       (pUIWorkspace[mm_ProcessRAMtop] -
					current_ramtop) * sizeof(unit));
			}
		} else {
			isostatus++;
		}
	}

	if (!krnlPointerCommand(pUIWorkspace[mm_PointerCommand]))
		isostatus++;
	if (!krnlAPDCommand(pUIWorkspace[mm_APDCommand]))
		isostatus++;
	if (!krnlDisplayCommand(pUIWorkspace[mm_DisplayCommand]))
		isostatus++;
	if (!krnlPCMdataCommand(pUIWorkspace[mm_PCMdataCommand]))
		isostatus++;
	if (!krnlConsoleCommand(pUIWorkspace[mm_ConsoleCommand]))
		isostatus++;
	if (!krnlFileCommand(pUIWorkspace[mm_FileCommand]))
		isostatus++;
	if (!krnlSYStimeCommand(pUIWorkspace[mm_SYStimeCommand]))
		isostatus++;
	if (!krnlPrinterCommand(pUIWorkspace[mm_PrinterCommand]))
		isostatus++;
	if (!krnlProcessCommand(pUIWorkspace[mm_ProcessCommand]))
		isostatus++;
#ifdef pr_network
	if (!krnlNetCommand(pUIWorkspace[mm_NetCommand]))
		isostatus++;
#endif
	if (!krnlGlobalKCommand(pUIWorkspace[mm_GlobalKCommand]))
		isostatus++;
	if (!krnlClipCommand(pUIWorkspace[mm_ClipCommand]))
		isostatus++;


	/* clear all command codes */
	pUIWorkspace[mm_DisplayCommand] = IDLE;
	pUIWorkspace[mm_PCMdataCommand] = IDLE;
	pUIWorkspace[mm_ConsoleCommand] = IDLE;
	pUIWorkspace[mm_PointerCommand] = IDLE;
	pUIWorkspace[mm_FileCommand] = IDLE;
	pUIWorkspace[mm_SYStimeCommand] = IDLE;
	pUIWorkspace[mm_APDCommand] = IDLE;
	pUIWorkspace[mm_PrinterCommand] = IDLE;
	pUIWorkspace[mm_ProcessCommand] = IDLE;
	pUIWorkspace[mm_NetCommand] = IDLE;
	pUIWorkspace[mm_GlobalKCommand] = IDLE;
	pUIWorkspace[mm_ClipCommand] = IDLE;

	if (isostatus > 0) {
		PRINT("ISOKRNLCALL failed.\n");
	} else {
		PRINT("ISOKRNLCALL ok.\n");
	}

}