FskErr KplAudioStop(KplAudio audio)
{
	if (audio->thread) {
        audio->stopping = true;
		FskThreadJoin(audio->thread);
	}
	return kFskErrNone;
}
Beispiel #2
0
void FskGtkWindowDispose(FskWindow fskWindow)
{
	FskGtkWindow gtkWin = (FskGtkWindow)fskWindow->gtkWin;

	gtk_main_quit();
	FskThreadJoin(fskWindow->gtkThread);
	FskMutexDispose(gtkWin->bufMutex);
	FskMutexDispose(gtkWin->menuMutex);
}
Beispiel #3
0
void KprServicesStop(KprShell shell)
{
	KprService service = gServices;
	gServicesThreadQuitting = true;
	FskThreadJoin(gServicesThread);
	while (service) {
		if (!(service->flags & kprServicesThread))
			(*service->stop)(service);
		service = service->next;
	}
}
Beispiel #4
0
FskErr KplScreenDisposeBitmap(KplBitmap bitmap)
{
	FskErr err = kFskErrNone;
	KplScreen screen = gKplScreen;

	if (bitmap != screen->bitmap)
		return kFskErrOperationFailed;

	if (screen->thread) {
//		KplScreenEventWakeUp();
		FskThreadJoin(screen->thread);
		screen->thread = NULL;
	}
#if SUPPORT_FLIP_THREAD
	if (screen->flipThread) {
		KplScreenUnlockBitmap(bitmap);
		FskThreadJoin(screen->flipThread);
		screen->flipThread = NULL;
	}
#endif
	if (screen->fbfd == -1) {
		FskMemPtrDispose(screen->framebuffer);
	}
	else {
		munmap(screen->framebuffer, screen->finfo.smem_len);
		close(screen->fbfd);
	}

    FskBitmapDispose(screen->touchDown);

#if SUPPORT_FLIP_THREAD
	FskSemaphoreDispose(screen->flipSemaphore);
#endif

	FskMemPtrDispose(screen);

	terminateLinuxInput();

	gKplScreen = NULL;
	return err;
}
Beispiel #5
0
void KprServicesStop(KprShell shell)
{
	KprService service = gServices;
	FskInstrumentedTypePrintfNormal(&KprServiceInstrumentation, "Stopping %s", service->id);
	gServicesThreadQuitting = true;
	FskThreadJoin(gServicesThread);
	while (service) {
		if (!(service->flags & kprServicesThread))
			(*service->stop)(service);
		service = service->next;
	}
}
void gpioThreadQuit(void)
{
    uint64_t one = 1;

    gGPIOThreadQuit = true;
    write(gGPIOEventFD, &one, sizeof(one));
    FskThreadJoin(gGPIOThread);
    gGPIOThread = NULL;
    gGPIOThreadQuit = false;
    close(gGPIOEventFD);
    gGPIOEventFD = -1;
}
FskErr KplAudioDispose(KplAudio audio)
{
	FskErr err = kFskErrNone;

    if (!audio) goto bail;

	if (audio->thread) {
		audio->stopping = true;
		FskThreadJoin(audio->thread);
	}
	KplMutexDispose(audio->mutex);
	audio->mutex = NULL;
	FskMemPtrDispose(audio->data);
	FskMemPtrDispose(audio);
bail:
	return err;
}
Beispiel #8
0
FskErr KplScreenDisposeBitmap(KplBitmap bitmap)
{

	if (bitmap != gKplScreen->bitmap)
		return kFskErrOperationFailed;

	if (gKplScreen) {
		if (gKplScreen->flipThread)
			FskThreadJoin(gKplScreen->flipThread);
		FskMemPtrDispose(gKplScreen->bitmap);
		FskMemPtrDisposeAt(&gKplScreen);

		FskSemaphoreDispose(gKplScreen->flipSemaphore);
	}

	terminateLinuxInput();
	return kFskErrNone;
}
Beispiel #9
0
void FskGtkWindowDispose(FskWindow fskWindow)
{
	gtk_main_quit();
	FskThreadJoin(fskWindow->gtkThread);
}