关于erlang:halt的更新说明

摘自:http://www.erlang.org/download/otp_src_R15B01.readme

OTP-9985  == erts stdlib ==



     When an escript ends now all printout to standard output and
     standard error gets out on the terminal. This bug has been
     corrected by changing the behaviour of erlang:halt/0,1, which
     should fix the same problem for other escript-like
     applications, i.e that data stored in the output port driver
     buffers got lost when printing on a TTY and exiting through
     erlang:halt/0,1.


     The BIF:s erlang:halt/0,1 has gotten improved semantics and
     there is a new BIF erlang:halt/2 to accomplish something like
     the old semantics. See the documentation.


     Now erlang:halt/0 and erlang:halt/1 with an integer argument
     will close all ports and allow all pending async threads
     operations to finish before exiting the emulator. Previously
     erlang:halt/0 and erlang:halt(0) would just wait for pending
     async threads operations but not close ports. And
     erlang:halt/1 with a non-zero integer argument would not even
     wait for pending async threads operations.


     To roughly the old behaviour, to not wait for ports and async
     threads operations when you exit the emulator, you use
     erlang:halt/2 with an integer first argument and an option
     list containing {flush,false} as the second argument. Note
     that now is flushing not dependant of the exit code, and you
     can not only flush async threads operations which we deemed
     as a strange behaviour anyway.


     Also, erlang:halt/1,2 has gotten a new feature: If the first
     argument is the atom 'abort' the emulator is aborted
     producing a core dump, if the operating system so allows.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值