Skip to content

Commit cf300a7

Browse files
zachs18RalfJung
andauthored
Update library/std/src/sys/pal/common/exit_guard.rs
Co-authored-by: Ralf Jung <[email protected]>
1 parent 079f999 commit cf300a7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

std/src/sys/pal/common/exit_guard.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ cfg_if::cfg_if! {
22
if #[cfg(target_os = "linux")] {
33
/// Mitigation for <https://github.com/rust-lang/rust/issues/126600>
44
///
5-
/// On UNIX-like platforms (where `libc::exit` may not be thread-safe), ensure that only one
5+
/// On glibc, `libc::exit` has been observed to not always be thread-safe.
6+
/// It is currently unclear whether that is a glibc bug or allowed by the standard.
7+
/// To mitigate this problem, we ensure that only one
68
/// Rust thread calls `libc::exit` (or returns from `main`) by calling this function before
79
/// calling `libc::exit` (or returning from `main`).
810
///
9-
/// Technically not enough to ensure soundness, since other code directly calling
10-
/// libc::exit will still race with this.
11+
/// Technically, this is not enough to ensure soundness, since other code directly calling
12+
/// `libc::exit` will still race with this.
1113
///
1214
/// *This function does not itself call `libc::exit`.* This is so it can also be used
1315
/// to guard returning from `main`.

0 commit comments

Comments
 (0)