Mercurial > hg > Game > Cerium
view TaskManager/Cell/CellHTaskInfo.cc @ 484:d6245cb38028 draft
fix CellHTask initialize..
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 05 Oct 2009 20:45:17 +0900 |
parents | 028ffc9c0375 |
children | 7ddbe22d4cdb |
line wrap: on
line source
#include <stdio.h> #include <stdlib.h> #include "CellHTaskInfo.h" int CellHTaskInfo::extend_pool(int num) { HTaskPtr q = NULL; q = (HTaskPtr)malloc(sizeof(HTask)*(num+1)); if (q == NULL) { return -1; } q->next = htaskPool; htaskPool = q; /* Connect all free queue in the pool */ for (q = htaskPool + 1; --num > 0; q++) { q->next = q + 1; posix_memalign((void**)&q->inData, DEFAULT_ALIGNMENT, sizeof(ListData)); posix_memalign((void**)&q->outData, DEFAULT_ALIGNMENT, sizeof(ListData)); q->wait_me = new TaskQueueInfo(); q->wait_i = new TaskQueueInfo(); } q->next = freeHTask; posix_memalign((void**)&q->inData, DEFAULT_ALIGNMENT, sizeof(ListData)); posix_memalign((void**)&q->outData, DEFAULT_ALIGNMENT, sizeof(ListData)); q->wait_me = new TaskQueueInfo(); q->wait_i = new TaskQueueInfo(); freeHTask = htaskPool + 1; return 0; }