whitespaces
This commit is contained in:
parent
5553e3eb54
commit
0f2169f664
@ -18,17 +18,22 @@
|
|||||||
void gfxQueueASyncInit(gfxQueueASync *pqueue) {
|
void gfxQueueASyncInit(gfxQueueASync *pqueue) {
|
||||||
pqueue->head = pqueue->tail = 0;
|
pqueue->head = pqueue->tail = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
gfxQueueASyncItem *gfxQueueASyncGet(gfxQueueASync *pqueue) {
|
gfxQueueASyncItem *gfxQueueASyncGet(gfxQueueASync *pqueue) {
|
||||||
gfxQueueASyncItem *pi;
|
gfxQueueASyncItem *pi;
|
||||||
|
|
||||||
if (!pqueue->head) return 0;
|
if (!pqueue->head)
|
||||||
|
return 0;
|
||||||
|
|
||||||
gfxSystemLock();
|
gfxSystemLock();
|
||||||
if ((pi = pqueue->head))
|
if ((pi = pqueue->head))
|
||||||
pqueue->head = pi->next;
|
pqueue->head = pi->next;
|
||||||
pi->next = 0;
|
pi->next = 0;
|
||||||
gfxSystemUnlock();
|
gfxSystemUnlock();
|
||||||
|
|
||||||
return pi;
|
return pi;
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfxQueueASyncPut(gfxQueueASync *pqueue, gfxQueueASyncItem *pitem) {
|
void gfxQueueASyncPut(gfxQueueASync *pqueue, gfxQueueASyncItem *pitem) {
|
||||||
pitem->next = 0;
|
pitem->next = 0;
|
||||||
|
|
||||||
@ -41,6 +46,7 @@
|
|||||||
}
|
}
|
||||||
gfxSystemUnlock();
|
gfxSystemUnlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfxQueueASyncPush(gfxQueueASync *pqueue, gfxQueueASyncItem *pitem) {
|
void gfxQueueASyncPush(gfxQueueASync *pqueue, gfxQueueASyncItem *pitem) {
|
||||||
gfxSystemLock();
|
gfxSystemLock();
|
||||||
pitem->next = pqueue->head;
|
pitem->next = pqueue->head;
|
||||||
@ -49,10 +55,13 @@
|
|||||||
pqueue->tail = pitem;
|
pqueue->tail = pitem;
|
||||||
gfxSystemUnlock();
|
gfxSystemUnlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfxQueueASyncRemove(gfxQueueASync *pqueue, gfxQueueASyncItem *pitem) {
|
void gfxQueueASyncRemove(gfxQueueASync *pqueue, gfxQueueASyncItem *pitem) {
|
||||||
gfxQueueASyncItem *pi;
|
gfxQueueASyncItem *pi;
|
||||||
|
|
||||||
if (!pitem) return;
|
if (!pitem)
|
||||||
|
return;
|
||||||
|
|
||||||
gfxSystemLock();
|
gfxSystemLock();
|
||||||
if (pqueue->head) {
|
if (pqueue->head) {
|
||||||
if (pqueue->head == pitem) {
|
if (pqueue->head == pitem) {
|
||||||
@ -72,9 +81,11 @@
|
|||||||
}
|
}
|
||||||
gfxSystemUnlock();
|
gfxSystemUnlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool_t gfxQueueASyncIsEmpty(gfxQueueASync *pqueue) {
|
bool_t gfxQueueASyncIsEmpty(gfxQueueASync *pqueue) {
|
||||||
return pqueue->head == NULL;
|
return pqueue->head == NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool_t gfxQueueASyncIsIn(gfxQueueASync *pqueue, const gfxQueueASyncItem *pitem) {
|
bool_t gfxQueueASyncIsIn(gfxQueueASync *pqueue, const gfxQueueASyncItem *pitem) {
|
||||||
gfxQueueASyncItem *pi;
|
gfxQueueASyncItem *pi;
|
||||||
|
|
||||||
@ -86,6 +97,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
gfxSystemUnlock();
|
gfxSystemUnlock();
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -95,17 +107,22 @@
|
|||||||
pqueue->head = pqueue->tail = 0;
|
pqueue->head = pqueue->tail = 0;
|
||||||
gfxSemInit(&pqueue->sem, 0, MAX_SEMAPHORE_COUNT);
|
gfxSemInit(&pqueue->sem, 0, MAX_SEMAPHORE_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
gfxQueueGSyncItem *gfxQueueGSyncGet(gfxQueueGSync *pqueue, delaytime_t ms) {
|
gfxQueueGSyncItem *gfxQueueGSyncGet(gfxQueueGSync *pqueue, delaytime_t ms) {
|
||||||
gfxQueueGSyncItem *pi;
|
gfxQueueGSyncItem *pi;
|
||||||
|
|
||||||
if (!gfxSemWait(&pqueue->sem, ms)) return 0;
|
if (!gfxSemWait(&pqueue->sem, ms))
|
||||||
|
return 0;
|
||||||
|
|
||||||
gfxSystemLock();
|
gfxSystemLock();
|
||||||
pi = pqueue->head;
|
pi = pqueue->head;
|
||||||
pqueue->head = pi->next;
|
pqueue->head = pi->next;
|
||||||
pi->next = 0;
|
pi->next = 0;
|
||||||
gfxSystemUnlock();
|
gfxSystemUnlock();
|
||||||
|
|
||||||
return pi;
|
return pi;
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfxQueueGSyncPut(gfxQueueGSync *pqueue, gfxQueueGSyncItem *pitem) {
|
void gfxQueueGSyncPut(gfxQueueGSync *pqueue, gfxQueueGSyncItem *pitem) {
|
||||||
pitem->next = 0;
|
pitem->next = 0;
|
||||||
|
|
||||||
@ -120,6 +137,7 @@
|
|||||||
|
|
||||||
gfxSemSignal(&pqueue->sem);
|
gfxSemSignal(&pqueue->sem);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfxQueueGSyncPush(gfxQueueGSync *pqueue, gfxQueueGSyncItem *pitem) {
|
void gfxQueueGSyncPush(gfxQueueGSync *pqueue, gfxQueueGSyncItem *pitem) {
|
||||||
gfxSystemLock();
|
gfxSystemLock();
|
||||||
pitem->next = pqueue->head;
|
pitem->next = pqueue->head;
|
||||||
@ -130,10 +148,13 @@
|
|||||||
|
|
||||||
gfxSemSignal(&pqueue->sem);
|
gfxSemSignal(&pqueue->sem);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfxQueueGSyncRemove(gfxQueueGSync *pqueue, gfxQueueGSyncItem *pitem) {
|
void gfxQueueGSyncRemove(gfxQueueGSync *pqueue, gfxQueueGSyncItem *pitem) {
|
||||||
gfxQueueGSyncItem *pi;
|
gfxQueueGSyncItem *pi;
|
||||||
|
|
||||||
if (!pitem) return;
|
if (!pitem)
|
||||||
|
return;
|
||||||
|
|
||||||
gfxSystemLock();
|
gfxSystemLock();
|
||||||
if (pqueue->head) {
|
if (pqueue->head) {
|
||||||
if (pqueue->head == pitem) {
|
if (pqueue->head == pitem) {
|
||||||
@ -153,9 +174,11 @@
|
|||||||
}
|
}
|
||||||
gfxSystemUnlock();
|
gfxSystemUnlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool_t gfxQueueGSyncIsEmpty(gfxQueueGSync *pqueue) {
|
bool_t gfxQueueGSyncIsEmpty(gfxQueueGSync *pqueue) {
|
||||||
return pqueue->head == NULL;
|
return pqueue->head == NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool_t gfxQueueGSyncIsIn(gfxQueueGSync *pqueue, const gfxQueueGSyncItem *pitem) {
|
bool_t gfxQueueGSyncIsIn(gfxQueueGSync *pqueue, const gfxQueueGSyncItem *pitem) {
|
||||||
gfxQueueGSyncItem *pi;
|
gfxQueueGSyncItem *pi;
|
||||||
|
|
||||||
@ -167,6 +190,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
gfxSystemUnlock();
|
gfxSystemUnlock();
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -176,10 +200,13 @@
|
|||||||
pqueue->head = pqueue->tail = 0;
|
pqueue->head = pqueue->tail = 0;
|
||||||
gfxSemInit(&pqueue->sem, 0, MAX_SEMAPHORE_COUNT);
|
gfxSemInit(&pqueue->sem, 0, MAX_SEMAPHORE_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
gfxQueueFSyncItem *gfxQueueFSyncGet(gfxQueueFSync *pqueue, delaytime_t ms) {
|
gfxQueueFSyncItem *gfxQueueFSyncGet(gfxQueueFSync *pqueue, delaytime_t ms) {
|
||||||
gfxQueueFSyncItem *pi;
|
gfxQueueFSyncItem *pi;
|
||||||
|
|
||||||
if (!gfxSemWait(&pqueue->sem, ms)) return 0;
|
if (!gfxSemWait(&pqueue->sem, ms))
|
||||||
|
return 0;
|
||||||
|
|
||||||
gfxSystemLock();
|
gfxSystemLock();
|
||||||
pi = pqueue->head;
|
pi = pqueue->head;
|
||||||
pqueue->head = pi->next;
|
pqueue->head = pi->next;
|
||||||
@ -188,8 +215,10 @@
|
|||||||
|
|
||||||
gfxSemSignalI(&pi->sem);
|
gfxSemSignalI(&pi->sem);
|
||||||
gfxSemDestroy(&pi->sem);
|
gfxSemDestroy(&pi->sem);
|
||||||
|
|
||||||
return pi;
|
return pi;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool_t gfxQueueFSyncPut(gfxQueueFSync *pqueue, gfxQueueFSyncItem *pitem, delaytime_t ms) {
|
bool_t gfxQueueFSyncPut(gfxQueueFSync *pqueue, gfxQueueFSyncItem *pitem, delaytime_t ms) {
|
||||||
gfxSemInit(&pitem->sem, 0, 1);
|
gfxSemInit(&pitem->sem, 0, 1);
|
||||||
pitem->next = 0;
|
pitem->next = 0;
|
||||||
@ -204,8 +233,10 @@
|
|||||||
gfxSystemUnlock();
|
gfxSystemUnlock();
|
||||||
|
|
||||||
gfxSemSignal(&pqueue->sem);
|
gfxSemSignal(&pqueue->sem);
|
||||||
|
|
||||||
return gfxSemWait(&pitem->sem, ms);
|
return gfxSemWait(&pitem->sem, ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool_t gfxQueueFSyncPush(gfxQueueFSync *pqueue, gfxQueueFSyncItem *pitem, delaytime_t ms) {
|
bool_t gfxQueueFSyncPush(gfxQueueFSync *pqueue, gfxQueueFSyncItem *pitem, delaytime_t ms) {
|
||||||
gfxSemInit(&pitem->sem, 0, 1);
|
gfxSemInit(&pitem->sem, 0, 1);
|
||||||
|
|
||||||
@ -217,12 +248,16 @@
|
|||||||
gfxSystemUnlock();
|
gfxSystemUnlock();
|
||||||
|
|
||||||
gfxSemSignal(&pqueue->sem);
|
gfxSemSignal(&pqueue->sem);
|
||||||
|
|
||||||
return gfxSemWait(&pitem->sem, ms);
|
return gfxSemWait(&pitem->sem, ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfxQueueFSyncRemove(gfxQueueFSync *pqueue, gfxQueueFSyncItem *pitem) {
|
void gfxQueueFSyncRemove(gfxQueueFSync *pqueue, gfxQueueFSyncItem *pitem) {
|
||||||
gfxQueueFSyncItem *pi;
|
gfxQueueFSyncItem *pi;
|
||||||
|
|
||||||
if (!pitem) return;
|
if (!pitem)
|
||||||
|
return;
|
||||||
|
|
||||||
gfxSystemLock();
|
gfxSystemLock();
|
||||||
if (pqueue->head) {
|
if (pqueue->head) {
|
||||||
if (pqueue->head == pitem) {
|
if (pqueue->head == pitem) {
|
||||||
@ -245,9 +280,11 @@
|
|||||||
}
|
}
|
||||||
gfxSystemUnlock();
|
gfxSystemUnlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool_t gfxQueueFSyncIsEmpty(gfxQueueFSync *pqueue) {
|
bool_t gfxQueueFSyncIsEmpty(gfxQueueFSync *pqueue) {
|
||||||
return pqueue->head == NULL;
|
return pqueue->head == NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool_t gfxQueueFSyncIsIn(gfxQueueFSync *pqueue, const gfxQueueFSyncItem *pitem) {
|
bool_t gfxQueueFSyncIsIn(gfxQueueFSync *pqueue, const gfxQueueFSyncItem *pitem) {
|
||||||
gfxQueueASyncItem *pi;
|
gfxQueueASyncItem *pi;
|
||||||
|
|
||||||
@ -259,8 +296,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
gfxSystemUnlock();
|
gfxSystemUnlock();
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* GFX_USE_GQUEUE */
|
#endif /* GFX_USE_GQUEUE */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user