diff TaskManager/kernel/ppe/TaskQueueInfo.cc @ 481:4896dffad67c

Double linked list modification done (tested on Mac OS X)
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 05 Oct 2009 16:46:46 +0900
parents 46464727d825
children 0b933bef0328
line wrap: on
line diff
--- a/TaskManager/kernel/ppe/TaskQueueInfo.cc	Mon Oct 05 12:24:07 2009 +0900
+++ b/TaskManager/kernel/ppe/TaskQueueInfo.cc	Mon Oct 05 16:46:46 2009 +0900
@@ -18,6 +18,7 @@
     // 最初の一つは自分
     first = last = this;
     next = prev = this;
+    waiter = NULL;
     return 0;
 }
 
@@ -57,6 +58,7 @@
 
     q->task = task;
     q->next = q->prev = NULL;
+    q->waiter = NULL;
 
     return q;
 }
@@ -65,6 +67,7 @@
 void
 TaskQueueInfo::free(TaskQueuePtr q)
 {
+    if (!q) return;
     q->next = freeTaskQueue;
     q->prev = NULL;
     freeTaskQueue = q;
@@ -137,6 +140,8 @@
 int
 TaskQueueInfo::remove(TaskQueue* e)
 {
+    if (!e) return 0;
+
     e->prev->next = e->next;
     e->next->prev = e->prev;