Mercurial > hg > Game > Cerium
diff TaskManager/kernel/ppe/MailManager.cc @ 640:ecf056ddd21a draft
SimpeTask on Cell worked.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 20 Nov 2009 23:12:34 +0900 |
parents | 57ec231bc8ac |
children | 2a611e8d8788 |
line wrap: on
line diff
--- a/TaskManager/kernel/ppe/MailManager.cc Thu Nov 19 18:45:24 2009 +0900 +++ b/TaskManager/kernel/ppe/MailManager.cc Fri Nov 20 23:12:34 2009 +0900 @@ -98,3 +98,24 @@ return list; } } + +int +MailManager::length(MailQueuePtr list) +{ + MailQueuePtr p = list; + MailQueuePtr q = p; + int i = 0; + + while(p) { + i++; + p=p->next; + if (i%2==0) { + q = q->next; + } + if (p==q) + return -1; // means loop + } + return i; +} + +/* end */