aboutsummaryrefslogtreecommitdiffstats
path: root/src/gqueue
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2013-06-10 17:18:01 +1000
committerinmarket <andrewh@inmarket.com.au>2013-06-10 17:18:01 +1000
commit2cb35d6815a0a12035f4792c266b688c77085620 (patch)
tree292ebc4760767d67b41f7f0e0022185afcf05067 /src/gqueue
parent777ec6af7c1b594f7b7a9cbaaf7ead90d8fb7e8f (diff)
downloaduGFX-2cb35d6815a0a12035f4792c266b688c77085620.tar.gz
uGFX-2cb35d6815a0a12035f4792c266b688c77085620.tar.bz2
uGFX-2cb35d6815a0a12035f4792c266b688c77085620.zip
Clean up GWIN Event assignment. Optimise event efficiency.
Diffstat (limited to 'src/gqueue')
-rw-r--r--src/gqueue/gqueue.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gqueue/gqueue.c b/src/gqueue/gqueue.c
index 11d10c0a..002378b3 100644
--- a/src/gqueue/gqueue.c
+++ b/src/gqueue/gqueue.c
@@ -37,6 +37,7 @@
gfxSystemLock();
if ((pi = pqueue->head))
pqueue->head = pi->next;
+ pi->next = 0;
gfxSystemUnlock();
return pi;
}
@@ -68,12 +69,14 @@
if (pqueue->head) {
if (pqueue->head == pitem) {
pqueue->head = pitem->next;
+ pitem->next = 0;
} else {
for(pi = pqueue->head; pi->next; pi = pi->next) {
if (pi->next == pitem) {
pi->next = pitem->next;
if (pqueue->tail == pitem)
pqueue->tail = pi;
+ pitem->next = 0;
break;
}
}
@@ -111,6 +114,7 @@
gfxSystemLock();
pi = pqueue->head;
pqueue->head = pi->next;
+ pi->next = 0;
gfxSytemUnlock();
return pi;
}
@@ -146,12 +150,14 @@
if (pqueue->head) {
if (pqueue->head == pitem) {
pqueue->head = pitem->next;
+ pitem->next = 0;
} else {
for(pi = pqueue->head; pi->next; pi = pi->next) {
if (pi->next == pitem) {
pi->next = pitem->next;
if (pqueue->tail == pitem)
pqueue->tail = pi;
+ pitem->next = 0;
break;
}
}
@@ -189,6 +195,7 @@
gfxSystemLock();
pi = pqueue->head;
pqueue->head = pi->next;
+ pi->next = 0;
gfxSytemUnlock();
gfxSemSignalI(&pi->sem);
@@ -233,6 +240,7 @@
if (pqueue->head == pitem) {
pqueue->head = pitem->next;
found:
+ pitem->next = 0;
gfxSystemUnlock();
gfxSemSignal(&pitem->sem);
gfxSemDestroy(&pitem->sem);