Mercurial > hg > Game > Cerium
annotate TaskManager/kernel/ppe/SynchronizedMailManager.h @ 1546:61164c687b29 draft
fix GpuScheduler flip
author | Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 05 Feb 2013 13:15:46 +0900 |
parents | 27e35b4098a4 |
children | f73ca57cdc81 |
rev | line source |
---|---|
1196
27e35b4098a4
Rename MailManager
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents:
1189
diff
changeset
|
1 #ifndef INCLUDED_SYNC_MAIL_MANAGER |
27e35b4098a4
Rename MailManager
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents:
1189
diff
changeset
|
2 #define INCLUDED_SYNC_MAIL_MANAGER |
1189 | 3 |
4 #include <pthread.h> | |
5 #include "MailManager.h" | |
6 #include "types.h" | |
7 #include "Sem.h" | |
8 | |
1196
27e35b4098a4
Rename MailManager
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents:
1189
diff
changeset
|
9 class SynchronizedMailManager : public MailManager { |
1189 | 10 public: |
11 /* constructor */ | |
1196
27e35b4098a4
Rename MailManager
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents:
1189
diff
changeset
|
12 SynchronizedMailManager(unsigned int qsize = 32) ; |
1189 | 13 |
1196
27e35b4098a4
Rename MailManager
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents:
1189
diff
changeset
|
14 ~SynchronizedMailManager(); |
1189 | 15 |
16 /* functions */ | |
17 void send(memaddr data); | |
18 memaddr recv(); | |
19 int count(); | |
20 | |
21 private: | |
22 /* variables */ | |
23 memaddr *queue; | |
24 SemPtr queue_remain; | |
25 SemPtr queue_count; | |
26 unsigned int size; | |
27 unsigned int read; | |
28 unsigned int write; | |
29 unsigned int mask; | |
30 | |
31 void calc_mask(unsigned int qsize); | |
32 void extend(); | |
33 } ; | |
34 | |
1196
27e35b4098a4
Rename MailManager
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents:
1189
diff
changeset
|
35 typedef SynchronizedMailManager *SynchronizedMailManagerPtr; |
1189 | 36 |
37 #endif |