File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -2296,6 +2296,15 @@ impl Child {
22962296/// }
22972297/// ```
22982298///
2299+ /// In its current implementation, this function will execute exit handlers registered with `atexit`
2300+ /// as well as other platform-specific exit handlers (e.g. `fini` sections of ELF shared objects).
2301+ /// This means that Rust requires that all exit handlers are safe to execute at any time. In
2302+ /// particular, if an exit handler cleans up some state that might be concurrently accessed by other
2303+ /// threads, it is required that the exit handler performs suitable synchronization with those
2304+ /// threads. (The alternative to this requirement would be to not run exit handlers at all, which is
2305+ /// considered undesirable. Note that returning from `main` also calls `exit`, so making `exit` an
2306+ /// unsafe operation is not an option.)
2307+ ///
22992308/// ## Platform-specific behavior
23002309///
23012310/// **Unix**: On Unix-like platforms, it is unlikely that all 32 bits of `exit`
You can’t perform that action at this time.
0 commit comments