# HG changeset patch # User Shinji KONO # Date 1280965737 -32400 # Node ID 8d6f7a42d134780add519b60458256dca2472e04 # Parent efee36d2f84ce4d0c7aadb748d0b49b495b5d55e QueueInfo fix diff -r efee36d2f84c -r 8d6f7a42d134 TaskManager/kernel/ppe/QueueInfo.h --- a/TaskManager/kernel/ppe/QueueInfo.h Wed Aug 04 23:05:59 2010 +0900 +++ b/TaskManager/kernel/ppe/QueueInfo.h Thu Aug 05 08:48:57 2010 +0900 @@ -27,12 +27,11 @@ /* constructor */ /** - singleton constructor - use this in non initialize envrionment is wrong. + singleton queuePool constructor + Do not use this as a Queue */ QueueInfo(){ queueInfoInit(); - queuePool = this; } /** normal constructor requires @@ -89,7 +88,7 @@ /** - singleton constructor + Use singleton queuePool constructor all queueInfo should share this as a pool. exteren QueueInfo pool; @@ -123,6 +122,10 @@ templateint QueueInfo::extend_pool(int num) { +#ifdef CHECK + if (queuePool) fprintf(stderr, "don't use queuePool directly"); +#endif + T* q = (T*)malloc(sizeof(T)*(num+1)+DEFAULT_ALIGNMENT); // First Queue is previous pool @@ -135,7 +138,7 @@ for (; num-- > 0;) { p->waiter = NULL; p->initOnce(); - queuePool->addLast(p); + addLast(p); p = (T*)ROUND_UP_ALIGN((long)(p+1),DEFAULT_ALIGNMENT); } diff -r efee36d2f84c -r 8d6f7a42d134 example/task_queue/main.cc --- a/example/task_queue/main.cc Wed Aug 04 23:05:59 2010 +0900 +++ b/example/task_queue/main.cc Thu Aug 05 08:48:57 2010 +0900 @@ -64,7 +64,7 @@ queues.i = 0; for (int i = 0; i < MAX_QUEUE; i++) { QueueInfo *q = new QueueInfo(mainPool) ; - // QueueInfo *q = new QueueInfo() ; + // QueueInfo *q = new QueueInfo() ; // wrong queues.q[i] = q; }