Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e24a9572 authored by Chris Manton's avatar Chris Manton
Browse files

main::shim::stack: Use internal stack manager access

No need to use external API which involves acquiring a recursive mutex lock

Bug: 343805735
Test: m .
Flag: EXEMPT, Mechanical Refactor

Change-Id: I5f84b0f356e4d1c39cd3de16c9cab3056c11acc9
parent d052105b
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -67,12 +67,11 @@ class Stack {
  // Run the callable object on the module instance
  template <typename T>
  bool CallOnModule(std::function<void(T* mod)> run) {
    std::lock_guard<std::recursive_mutex> lock(Stack::GetInstance()->mutex_);
    if (Stack::GetInstance()->is_running_) {
      run(Stack::GetInstance()->GetStackManager()->GetInstance<T>());
      return true;
    std::lock_guard<std::recursive_mutex> lock(mutex_);
    if (is_running_) {
      run(stack_manager_.GetInstance<T>());
    }
    return false;
    return is_running_;
  }

  size_t NumModules() const { return num_modules_; }