comparison TaskManager/kernel/ppe/TaskQueue.cc @ 479:bf2d2625485e draft

Double Linked List base TaskQueue
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 05 Oct 2009 10:36:37 +0900
parents 028ffc9c0375
children 5f4ffff2c2aa
comparison
equal deleted inserted replaced
478:b31019c79c34 479:bf2d2625485e
1 #include "TaskQueue.h" 1 #include "TaskQueue.h"
2 2
3 TaskQueue::TaskQueue(TaskPtr q) 3 TaskQueue::TaskQueue(Task *q)
4 { 4 {
5 task = q; 5 task = q;
6 next = NULL; 6 next = NULL;
7 prev = NULL;
8 waiter = NULL;
7 } 9 }
8 10
9 TaskQueuePtr
10 TaskQueue::append(TaskQueuePtr list, TaskQueuePtr q)
11 {
12 TaskQueuePtr p = list;
13
14 if (!p) {
15 return q;
16 } else {
17 while(p->next) p = p->next;
18 p->next = q;
19 return list;
20 }
21 }