void gfxQueueFSyncRemove(gfxQueueFSync *pqueue, gfxQueueFSyncItem *pitem) { gfxQueueFSyncItem *pi; if (!pitem) return; // Safety gfxSystemLock(); if (pqueue->head) { if (pqueue->head == pitem) { pqueue->head = pitem->next; found: pitem->next = 0; gfxSystemUnlock(); gfxSemSignal(&pitem->sem); gfxSemDestroy(&pitem->sem); return; } for(pi = pqueue->head; pi->next; pi = pi->next) { if (pi->next == pitem) { pi->next = pitem->next; if (pqueue->tail == pitem) pqueue->tail = pi; goto found; } } } gfxSystemUnlock(); }
gfxQueueFSyncItem *gfxQueueFSyncGet(gfxQueueFSync *pqueue, delaytime_t ms) { gfxQueueFSyncItem *pi; if (!gfxSemWait(&pqueue->sem, ms)) return 0; gfxSystemLock(); pi = pqueue->head; pqueue->head = pi->next; gfxSytemUnlock(); gfxSemSignalI(&pi->sem); gfxSemDestroy(&pi->sem); return pi; }
void _gwmDeinit(void) { GHandle gh; while((gh = gwinGetNextWindow(0))) gwinDestroy(gh); _GWINwm->vmt->DeInit(); #if !GWIN_REDRAW_IMMEDIATE gtimerDeinit(&RedrawTimer); #endif gfxQueueASyncDeinit(&_GWINList); gfxSemDestroy(&gwinsem); }
void _gtimerDeinit(void) { gfxSemDestroy(&waitsem); gfxMutexDestroy(&mutex); // Need to destroy GTimer thread here }
void gfxQueueFSyncDeinit(gfxQueueGSync *pqueue) { while(gfxQueueFSyncGet(pqueue, TIME_IMMEDIATE)); pqueue->head = pqueue->tail = 0; gfxSemDestroy(&pqueue->sem); }
void gfxQueueGSyncDeinit(gfxQueueGSync *pqueue) { pqueue->head = pqueue->tail = 0; gfxSemDestroy(&pqueue->sem); }