Revert "init: handle property service callbacks asynchronously"
This is apparently causing problems with reboot.
This reverts commit 7205c6293341c82701e849fa29cfab66916d1052.
Bug: 150863651
Test: build
Change-Id: Ib8a4835cdc8358a54c7acdebc5c95038963a0419
diff --git a/init/action_manager.cpp b/init/action_manager.cpp
index b45f5cd..ebca762 100644
--- a/init/action_manager.cpp
+++ b/init/action_manager.cpp
@@ -41,12 +41,10 @@
}
void ActionManager::QueueEventTrigger(const std::string& trigger) {
- auto lock = std::lock_guard{event_queue_lock_};
event_queue_.emplace(trigger);
}
void ActionManager::QueuePropertyChange(const std::string& name, const std::string& value) {
- auto lock = std::lock_guard{event_queue_lock_};
event_queue_.emplace(std::make_pair(name, value));
}
@@ -55,7 +53,6 @@
}
void ActionManager::QueueBuiltinAction(BuiltinFunction func, const std::string& name) {
- auto lock = std::lock_guard{event_queue_lock_};
auto action = std::make_unique<Action>(true, nullptr, "<Builtin Action>", 0, name,
std::map<std::string, std::string>{});
action->AddCommand(std::move(func), {name}, 0);
@@ -65,18 +62,15 @@
}
void ActionManager::ExecuteOneCommand() {
- {
- auto lock = std::lock_guard{event_queue_lock_};
- // Loop through the event queue until we have an action to execute
- while (current_executing_actions_.empty() && !event_queue_.empty()) {
- for (const auto& action : actions_) {
- if (std::visit([&action](const auto& event) { return action->CheckEvent(event); },
- event_queue_.front())) {
- current_executing_actions_.emplace(action.get());
- }
+ // Loop through the event queue until we have an action to execute
+ while (current_executing_actions_.empty() && !event_queue_.empty()) {
+ for (const auto& action : actions_) {
+ if (std::visit([&action](const auto& event) { return action->CheckEvent(event); },
+ event_queue_.front())) {
+ current_executing_actions_.emplace(action.get());
}
- event_queue_.pop();
}
+ event_queue_.pop();
}
if (current_executing_actions_.empty()) {
@@ -109,7 +103,6 @@
}
bool ActionManager::HasMoreCommands() const {
- auto lock = std::lock_guard{event_queue_lock_};
return !current_executing_actions_.empty() || !event_queue_.empty();
}
@@ -120,7 +113,6 @@
}
void ActionManager::ClearQueue() {
- auto lock = std::lock_guard{event_queue_lock_};
// We are shutting down so don't claim the oneshot builtin actions back
current_executing_actions_ = {};
event_queue_ = {};