Fix fully sync queue

This commit is contained in:
Tibo Clausen 2018-10-01 11:15:24 +02:00
parent df0200c0f9
commit e56ed290e3
2 changed files with 5 additions and 5 deletions

View File

@ -296,7 +296,7 @@ void _gqueueDeinit(void)
pqueue->head = pqueue->tail = 0;
gfxSemInit(&pqueue->sem, 0, MAX_SEMAPHORE_COUNT);
}
void gfxQueueFSyncDeinit(gfxQueueGSync *pqueue) {
void gfxQueueFSyncDeinit(gfxQueueFSync *pqueue) {
while(gfxQueueFSyncGet(pqueue, gDelayNone));
pqueue->head = pqueue->tail = 0;
gfxSemDestroy(&pqueue->sem);
@ -355,12 +355,12 @@ void _gqueueDeinit(void)
return gfxSemWait(&pitem->sem, ms);
}
gBool gfxQueueFSyncInsert(gfxQueueFSync *pqueue, gfxQueueFSyncItem *pitem, gfxQueueASyncItem *pafter, gDelay ms) {
gBool gfxQueueFSyncInsert(gfxQueueFSync *pqueue, gfxQueueFSyncItem *pitem, gfxQueueFSyncItem *pafter, gDelay ms) {
if (!pitem) return; // Safety
gfxSemInit(&pitem->sem, 0, 1);
gfxSystemLock();
if (pafter && gfxQueueGSyncIsInI(pqueue, pafter)) {
if (pafter && gfxQueueFSyncIsInI(pqueue, pafter)) {
pitem->next = pafter->next;
pafter->next = pitem;
if (pqueue->tail == pafter)
@ -419,7 +419,7 @@ void _gqueueDeinit(void)
return res;
}
gBool gfxQueueFSyncIsInI(gfxQueueFSync *pqueue, const gfxQueueFSyncItem *pitem) {
gfxQueueASyncItem *pi;
gfxQueueFSyncItem *pi;
for(pi = pqueue->head; pi; pi = pi->next) {
if (pi == pitem)

View File

@ -223,7 +223,7 @@ void gfxQueueASyncInsert(gfxQueueASync *pqueue, gfxQueueASyncItem *pitem, gfxQue
void gfxQueueASyncInsertI(gfxQueueASync *pqueue, gfxQueueASyncItem *pitem, gfxQueueASyncItem *pafter);
void gfxQueueGSyncInsert(gfxQueueGSync *pqueue, gfxQueueGSyncItem *pitem, gfxQueueASyncItem *pafter);
void gfxQueueGSyncInsertI(gfxQueueGSync *pqueue, gfxQueueGSyncItem *pitem, gfxQueueASyncItem *pafter);
gBool gfxQueueFSyncInsert(gfxQueueFSync *pqueue, gfxQueueFSyncItem *pitem, gfxQueueASyncItem *pafter, gDelay ms);
gBool gfxQueueFSyncInsert(gfxQueueFSync *pqueue, gfxQueueFSyncItem *pitem, gfxQueueFSyncItem *pafter, gDelay ms);
/** @} */
/**