changeset 1873:accb35bd3449 draft

fix CpuThreads, is this good?
author kkb
date Sat, 28 Dec 2013 19:30:42 +0900
parents a1bfda09128a
children 039e6d5cf5b7
files TaskManager/kernel/ppe/CpuThreads.cc TaskManager/kernel/ppe/CpuThreads.h
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/kernel/ppe/CpuThreads.cc	Fri Dec 27 20:58:30 2013 +0900
+++ b/TaskManager/kernel/ppe/CpuThreads.cc	Sat Dec 28 19:30:42 2013 +0900
@@ -66,9 +66,9 @@
     manager->set_scheduler(c_scheduler);
     SchedRegister(ShowTime);
     SchedRegister(StartProfile);
-    if (argt->cpuid >= cpu_num)
-	pthread_setschedparam();
-
+    if (argt->cpuid >= argt->cpu_num)
+        pthread_setschedparam(static_cast<CpuThreads*>(args)->threads[argt->cpuid], SCHED_OTHER, &(argt->priority));
+    
     argt->wait->sem_v();        //準備完了したスレッドができるたびに+1していく
 
     c_scheduler->run(new SchedNop());
@@ -98,7 +98,7 @@
 
     for (int i = 0; i < cpu_num; i++) {
         pthread_create(&threads[i], NULL,
-                      &cpu_thread_run, (void*)&args[i]);
+                       &cpu_thread_run, (void*)&args[i]);
     }
 
     for (int i = 0; i < cpu_num; i++) {
--- a/TaskManager/kernel/ppe/CpuThreads.h	Fri Dec 27 20:58:30 2013 +0900
+++ b/TaskManager/kernel/ppe/CpuThreads.h	Sat Dec 28 19:30:42 2013 +0900
@@ -12,7 +12,7 @@
     int cpuid;
     int id_offset;
     int cpu_num;
-    int priority;
+    struct sched_param priority;
     // should be syncrhonized
     MainScheduler *scheduler;
     TaskManagerImpl *manager;
@@ -26,7 +26,7 @@
 class CpuThreads : public Threads {
  public:
     /* constructor */
-    CpuThreads(int num = 1, int useRefDma = 0, int start_id = 0);
+    CpuThreads(int num = 1, int i_num = 0, int useRefDma = 0, int start_id = 0);
     ~CpuThreads();
     static void *cpu_thread_run(void *args);