博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
无法加载do_mount_all函数
阅读量:2383 次
发布时间:2019-05-10

本文共 3933 字,大约阅读时间需要 13 分钟。

函数

ExecuteOneCommand函数:

  1. ActionManager中std::queue<const Action*> current_executing_actions_;在64行向current_executing_actions_插入一个action,在处理完这个action中的所有command,在89行删除current_executing_actions_元素。
  2. 在61中轮询actions中的action, 如果某个action被满足event_queue_队列中触发条件,则会把这个action放入current_executing_actions_队列中。
58 void ActionManager::ExecuteOneCommand() {                                        59     // Loop through the event queue until we have an action to execute           60     while (current_executing_actions_.empty() && !event_queue_.empty()) {        61         for (const auto& action : actions_) {                                    62             if (std::visit([&action](const auto& event) { return action->CheckEvent(event); }, 63                            event_queue_.front())) {                              64                 current_executing_actions_.emplace(action.get());                65             }                                                                    66         }                                                                        67         event_queue_.pop();                                                      68     }                                                                            69                                                                                  70     if (current_executing_actions_.empty()) {                                    71         return;                                                                  72     }                                                                            73                                                                                  74     auto action = current_executing_actions_.front();                            75                                                                                  76     if (current_command_ == 0) {                                                 77         std::string trigger_name = action->BuildTriggersString();                78         LOG(INFO) << "processing action (" << trigger_name << ") from (" << action->filename() 79                   << ":" << action->line() << ")";                               80     }                                                                            81                                                                                  82     action->ExecuteOneCommand(current_command_);                                 83                                                                                  84     // If this was the last command in the current action, then remove           85     // the action from the executing list.                                       86     // If this action was oneshot, then also remove it from actions_.            87     ++current_command_;                                                          88     if (current_command_ == action->NumCommands()) {                             89         current_executing_actions_.pop();                                        90         current_command_ = 0;                                                    91         if (action->oneshot()) {                                                                                                                                                                         92             auto eraser = [&action](std::unique_ptr
& a) { return a.get() == action; }; 93 actions_.erase(std::remove_if(actions_.begin(), actions_.end(), eraser)); 94 } 95 } 96 }

通过打印信息知道:

init: 7 early-initinit: 7 initinit: 7 init: 7 load_persist_props_actioninit: 7 firmware_mounts_completeinit: 7 late-init可以知道actions_中包含event_name为early-init,init,load_persist_props_action,firmware_mounts_complete和late-init的action。 从打印中,可以看出init 的action中的命令没有执行完毕。

转载地址:http://eafab.baihongyu.com/

你可能感兴趣的文章
Django-HttpResponse返回models对象
查看>>
Windows资源管理器相关信息获取
查看>>
windows资源管理器及ie监听
查看>>
django工程部署到apache2上
查看>>
save_model ManyToManyField
查看>>
远程桌面 多人同时 使用谷歌浏览器
查看>>
No module named 'Crypto'
查看>>
虚拟化windows10操作系统遇到的问题
查看>>
cef3+duilb 多次弹窗问题
查看>>
openstack_cinder里面的volume的简单解析
查看>>
openstack创建实例失败,bug(1)解决办法
查看>>
openstack创建的云主机不能访问外网,不能ping www.baidu.com
查看>>
python input,raw_input函数
查看>>
浅谈openstack的neutron
查看>>
Openstack中说的二层和三层switch
查看>>
openstack云主机网卡的混杂模式
查看>>
虚拟化技术之QEMU
查看>>
虚拟化技术之KVM,搭建KVM(详细)
查看>>
KVM(桥接模式)宿主机创建网桥
查看>>
常用openstack的镜像下载及密码
查看>>