Erlang application stop 调用死锁
来源:互联网 发布:索尼nex5r网络设置 编辑:程序博客网 时间:2024/06/02 06:55
Erlang application stop 调用死锁
(金庆的专栏)
在application行为模块的start()中启动bson应用,在stop()中停止bson,
结果application:stop(bson)会死锁。
-module(my_app).
-behaviour(application).
%% Application callbacks
-export([start/2, stop/1]).
%% ===================================================================
%% Application callbacks
%% ===================================================================
start(_StartType, _StartArgs) ->
ok = application:start(bson),
{ok, Pid} = my_sup:start_link(),
{ok, Pid}.
stop(_State) ->
application:stop(bson),
ok.
参考 How to stop third-party Erlang applications
http://stackoverflow.com/questions/2305511/how-to-stop-third-party-erlang-applications
才明白stop()是回调,在回调中试图停止其他应用就会死锁。
stop()是应用控制器回调的,应用控制器在等待回调返回时,无法响应application:stop()请求,所以死锁了。
(金庆的专栏)
在application行为模块的start()中启动bson应用,在stop()中停止bson,
结果application:stop(bson)会死锁。
-module(my_app).
-behaviour(application).
%% Application callbacks
-export([start/2, stop/1]).
%% ===================================================================
%% Application callbacks
%% ===================================================================
start(_StartType, _StartArgs) ->
ok = application:start(bson),
{ok, Pid} = my_sup:start_link(),
{ok, Pid}.
stop(_State) ->
application:stop(bson),
ok.
参考 How to stop third-party Erlang applications
http://stackoverflow.com/questions/2305511/how-to-stop-third-party-erlang-applications
才明白stop()是回调,在回调中试图停止其他应用就会死锁。
stop()是应用控制器回调的,应用控制器在等待回调返回时,无法响应application:stop()请求,所以死锁了。
0 0
- Erlang application stop 调用死锁
- Erlang Application
- 创建Erlang的Application
- 创建Erlang的Application
- 创建Erlang的Application
- 理解Erlang/OTP - Application
- Erlang/OTP 构建 Application
- Erlang/OTP 构建 Application
- [Erlang 0025]理解Erlang/OTP - Application
- [Erlang]使用Erlang application有什么好处?
- sorry, the application has stop excepted
- Websphere: Stop Server and Uninstall Application
- Application 调用
- erlang另类方法调用
- erlang分布式调用效率
- Erlang调用C程序
- erlang 调用shell 命令
- erlang rpc 远程调用
- nyoj-19 擅长排列的小明 (dfs)
- 南邮 OJ 1654 集训
- ps学习笔记三(绘画与修饰工具组)
- Writing Resources
- Linux下mysql主从配置
- Erlang application stop 调用死锁
- mysql 备份与恢复
- iOS开发-自定义重用机制给ScrollerView添加子视图
- MongoDB集群读优先策略
- ROS学习--(十七)turtlebot的安装
- Zxing 生成条形码(一维码)
- grep使用技巧
- VC++2010 MFC程序怎么在其他电脑运行
- SQLAlchemy文档翻译第1章