rust/src/libstd
Alex Crichton 1ec9adcfc0 std: Tweak rt::at_exit behavior
There have been some recent panics on the bots and this commit is an attempt to
appease them. Previously it was considered invalid to run `rt::at_exit` after
the handlers had already started running. Due to the multithreaded nature of
applications, however, it is not always possible to guarantee this. For example
[this program][ex] will show off the abort.

[ex]: https://gist.github.com/alexcrichton/56300b87af6fa554e52d

The semantics of the `rt::at_exit` function have been modified as such:

* It is now legal to call `rt::at_exit` at any time. The return value now
  indicates whether the closure was successfully registered or not. Callers must
  now decide what to do with this information.
* The `rt::at_exit` handlers will now be run for a fixed number of iterations.
  Common cases (such as the example shown) may end up registering a new handler
  while others are running perhaps once or twice, so this common condition is
  covered by re-running the handlers a fixed number of times, after which new
  registrations are forbidden.

Some usage of `rt::at_exit` was updated to handle these new semantics, but
deprecated or unstable libraries calling `rt::at_exit` were not updated.
2015-03-21 11:14:58 -07:00
..
collections Register new snapshots 2015-03-18 16:32:32 -07:00
ffi Register new snapshots 2015-03-18 16:32:32 -07:00
fs Auto merge of #23470 - alexcrichton:less-prelude, r=aturon 2015-03-21 05:25:21 +00:00
io std: Tweak rt::at_exit behavior 2015-03-21 11:14:58 -07:00
net Auto merge of #23512 - oli-obk:result_ok_unwrap, r=alexcrichton 2015-03-20 23:16:47 +00:00
num std: Remove old_io/old_path from the prelude 2015-03-20 20:07:19 -07:00
old_io std: Tweak rt::at_exit behavior 2015-03-21 11:14:58 -07:00
old_path std: Remove old_io/old_path from the prelude 2015-03-20 20:07:19 -07:00
prelude std: Remove old_io/old_path from the prelude 2015-03-20 20:07:19 -07:00
rand Register new snapshots 2015-03-18 16:32:32 -07:00
rt std: Tweak rt::at_exit behavior 2015-03-21 11:14:58 -07:00
sync don't use Result::ok just to be able to use unwrap/unwrap_or 2015-03-20 08:19:13 +01:00
sys std: Tweak rt::at_exit behavior 2015-03-21 11:14:58 -07:00
thread_local Example -> Examples 2015-03-11 21:11:40 -04:00
time Fix Duration::weeks docs 2015-03-04 12:16:37 +00:00
ascii.rs Deprecate range, range_step, count, distributions 2015-03-13 14:45:13 -07:00
bool.rs Strip all leading/trailing newlines 2015-03-15 09:08:21 -07:00
dynamic_lib.rs std: Remove old_io/old_path from the prelude 2015-03-20 20:07:19 -07:00
env.rs std: Remove old_io/old_path from the prelude 2015-03-20 20:07:19 -07:00
lib.rs Rollup merge of #23392 - WiSaGaN:bugfix/fix_deprecate_link, r=Manishearth 2015-03-18 22:21:07 +05:30
macros.rs Document include! 2015-03-19 08:24:41 +05:30
os.rs std: Remove old_io/old_path from the prelude 2015-03-20 20:07:19 -07:00
panicking.rs Fallout of std::old_io deprecation 2015-03-13 10:00:28 -07:00
path.rs Register new snapshots 2015-03-18 16:32:32 -07:00
process.rs std: Remove old_io/old_path from the prelude 2015-03-20 20:07:19 -07:00
rtdeps.rs fixing trailing whitespace errors 2015-02-11 14:49:07 -08:00
thread.rs Auto merge of #23470 - alexcrichton:less-prelude, r=aturon 2015-03-21 05:25:21 +00:00
thunk.rs Switched to Box::new in many places. 2015-03-03 21:05:55 +01:00
tuple.rs Remove integer suffixes where the types in compiled code are identical. 2015-03-05 12:38:33 +05:30
unit.rs grandfathered -> rust1 2015-01-23 21:48:20 -08:00