Check SCHED_PRIORITY value 81/299581/1
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 5 Oct 2023 07:53:57 +0000 (16:53 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 5 Oct 2023 07:53:57 +0000 (16:53 +0900)
If the SCHED_PRIORITY value is not 0, the app-defined-loader and the
launchpad-loader set the scheduling priority to 0.

Change-Id: I0281548e724f2d3a7caba981630d48d3a790a6e2
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/app-defined-loader/app-defined-loader.cc
src/launchpad-loader/launchpad_loader.cc
src/launchpad-process-pool/loader_info.cc

index 1d55100..4ff94d4 100644 (file)
@@ -158,7 +158,9 @@ class AppDefinedLoader {
       _exit(EXIT_FAILURE);
     }
 
-    SchedPriority::Set(0);
+    auto* priority = bundle_get_val(extra, "SCHED_PRIORITY");
+    if (priority && strcmp(priority, "0") != 0)
+      SchedPriority::Set(0);
   }
 
   static int OnLaunch(int argc, char** argv, const char* app_path,
index d1cdf6f..d3cf7b4 100644 (file)
@@ -175,7 +175,9 @@ void LaunchpadLoader::OnCreate(const tizen_base::Bundle& extra, int type) {
   InitializeElementary();
 
   hw_acc_config_.reset(new launchpad::HWAccelerationConfig());
-  SchedPriority::Set(0);
+  auto priority = extra.GetString("SCHED_PRIORITY");
+  if (priority != "0")
+    SchedPriority::Set(0);
 }
 
 int LaunchpadLoader::OnLaunch(const LaunchArgs& args) {
index df00c5c..96aa9bd 100644 (file)
@@ -278,6 +278,7 @@ LoaderInfo::LoaderInfo(LoaderType type, std::string name, std::string exe,
       on_boot_timeout_(on_boot_timeout),
       sched_priority_(sched_priority),
       condition_path_exists_(std::move(condition_path_exists)) {
+  extra_.Add("SCHED_PRIORITY", std::to_string(sched_priority_));
 }
 
 LoaderType LoaderInfo::GetType() const {