Check LaunchMode before setting scheduling priority 74/295074/2
authorHwankyu Jhun <h.jhun@samsung.com>
Sun, 2 Jul 2023 23:17:43 +0000 (23:17 +0000)
committerHwanKyu Jhun <h.jhun@samsung.com>
Sun, 2 Jul 2023 23:33:30 +0000 (23:33 +0000)
Before setting the scheduling priority to the normal priority,
launchpad-process-pool should check whether the launch mode is
"Always_Loader_With_Low_Priority" or not.

Change-Id: I0b8d962f476b895384f37ea19deba020b25dad75
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/launchpad-process-pool/launchpad.cc

index 62cb876b263d83dfc0c6995ada5c79db5bacd97f..1891bf56cbb24f0546dbdf5858240ac585cf1cc8 100644 (file)
@@ -480,7 +480,9 @@ Launchpad::LaunchResult Launchpad::LaunchRequestPend(
     std::shared_ptr<Request> request) {
   auto loader_context = request->GetAvailableLoaderContext();
   if (loader_context->IsPrepared()) {
-    SchedPriority::Set(loader_context->GetPid(), 0);
+    if (mode_ == Config::LaunchMode::Mode::AlwaysLoaderWithLowPriority)
+      SchedPriority::Set(loader_context->GetPid(), 0);
+
     return LaunchResult::Continue;
   }