]> rtime.felk.cvut.cz Git - frescor/fosa.git/commitdiff
change sched params
authorsangorrin <sangorrin@35b4ef3e-fd22-0410-ab77-dab3279adceb>
Wed, 13 Jun 2007 18:04:45 +0000 (18:04 +0000)
committersangorrin <sangorrin@35b4ef3e-fd22-0410-ab77-dab3279adceb>
Wed, 13 Jun 2007 18:04:45 +0000 (18:04 +0000)
git-svn-id: http://www.frescor.org/private/svn/frescor/fosa/trunk@467 35b4ef3e-fd22-0410-ab77-dab3279adceb

src_marte/fosa_app_def_sched.c

index 86fe0be6aee469d3b72a9dac904ed7a2d46aca72..2d5d37a75a9bfd8893f0fa71ca31fc2ad183d15d 100644 (file)
@@ -632,26 +632,25 @@ int fosa_ads_set_appscheduled
         (frsh_thread_id_t thread,
          bool appscheduled)
 {
-  int error_code, current_policy, new_policy;
-  struct sched_param param;
-
-  // set the application-defined scheduler thread
-  error_code=pthread_setappscheduler(thread,scheduler_thread_id);
-  if (error_code!=0) return error_code;
-
-  // switch to the appropriate scheduling policy
-  if (appscheduled) {
-    new_policy=SCHED_APP;
-  } else {
-    new_policy=SCHED_FIFO;
-  }
-  CHK(pthread_getschedparam(thread,&current_policy,&param));
-  if (((current_policy==SCHED_APP) && (!appscheduled)) ||
-      ((current_policy!=SCHED_APP) && appscheduled))
-    {
+   int error_code = 0;
+   int current_policy, new_policy;
+   struct sched_param param;
+
+   // switch to the appropriate scheduling policy
+   CHK(pthread_getschedparam(thread,&current_policy,&param));
+   if (((current_policy==SCHED_APP) && (!appscheduled)) ||
+      ((current_policy!=SCHED_APP) && appscheduled)) {
+      if (appscheduled) {
+         new_policy=SCHED_APP;
+         // set the application-defined scheduler thread
+         error_code=pthread_setappscheduler(thread,scheduler_thread_id);
+         if (error_code!=0) return error_code;
+      } else {
+         new_policy=SCHED_FIFO;
+      }
       error_code=pthread_setschedparam(thread,new_policy,&param);
-    }
-  return error_code;
+   }
+   return error_code;
 }
 
 /**