Modify activation method 26/295026/2
authorChanggyu Choi <changyu.choi@samsung.com>
Fri, 30 Jun 2023 03:45:03 +0000 (12:45 +0900)
committerHwanKyu Jhun <h.jhun@samsung.com>
Sun, 2 Jul 2023 23:33:09 +0000 (23:33 +0000)
Change-Id: I55897427b3ecc56de36c461cbcc2f6801def5b9f
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
src/launchpad-process-pool/loader_context.cc
src/launchpad-process-pool/loader_context.hh
src/launchpad-process-pool/loader_manager.cc

index a1b1cfcddd0e7fb24acd26ae0a090b843ba20b25..53e8ab1b878c5361b8bf0fc1cb93784b35417dc0 100644 (file)
@@ -495,6 +495,11 @@ void LoaderContext::Deactivate() {
   Dispose();
 }
 
+bool LoaderContext::CanBeDetected(LoaderMethod method) const {
+  return (static_cast<int>(loader_info_->GetDetectionMethod()) &
+      static_cast<int>(method));
+}
+
 bool LoaderContext::CanActivate(LoaderMethod method) const {
   return (static_cast<int>(loader_info_->GetActivationMethod()) &
       static_cast<int>(method));
index 4561198d63238b5219950759104a79da7d02e2fe..15ad2b87533c9541f006e4a4ffe2e82ff648a4aa 100644 (file)
@@ -102,6 +102,7 @@ class LoaderContext : public std::enable_shared_from_this<LoaderContext>,
   void UpdatePssMemory();
   uint64_t GetPssMemory() const;
   unsigned int GetScore() const;
+  bool CanBeDetected(LoaderMethod method) const;
   bool CanActivate(LoaderMethod method) const;
   void UpdateState(LoaderMethod method, bool force);
   bool IsLaunchable();
index 7df3837f77f4867c92e122645d97c5d57970d454..8e4fc3e8a0dbb67bed916bffb9917084be407222 100644 (file)
@@ -128,7 +128,7 @@ void LoaderManager::ActivateLoaderContexts(LoaderMethod method) {
     if (context->GetPid() > 0)
       continue;
 
-    if (!context->IsTouched() || context->CanActivate(method)) {
+    if (!context->IsTouched() || context->CanBeDetected(method)) {
       context->UnsetTimer();
       context->SetLoaderMethod(method);
       sequencer_->Add(context);