annotate TaskManager/kernel/ppe/Threads.h @ 824:a75ccd570a57 draft

Thread.h fix?
author yutaka@localhost.localdomain
date Mon, 24 May 2010 23:51:40 +0900
parents 5d48fa762a24
children b662e9dd26b0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
817
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #ifndef INCLUDED_THREADS
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 #define INCLUDED_THREADS
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 #include <pthread.h>
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 class Threads {
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 public:
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 /* constructor */
824
a75ccd570a57 Thread.h fix?
yutaka@localhost.localdomain
parents: 818
diff changeset
10 Threads(int num = 1) {};
a75ccd570a57 Thread.h fix?
yutaka@localhost.localdomain
parents: 818
diff changeset
11 virtual ~Threads() {};
817
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 /* functions */
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 virtual void init() = 0;
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 virtual int get_mail(int speid, int count, memaddr *ret) = 0; // BLOCKING
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 virtual int has_mail(int speid, int count, memaddr *ret) = 0; // NONBLOCK
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 virtual void send_mail(int speid, int num, memaddr *data) = 0; // BLOCKING
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 /* variables */
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 pthread_t *threads;
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 int cpu_num;
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 };
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23
c7d737993da7 add CpuThreads.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 #endif