about summary refs log tree commit diff
diff options
context:
space:
mode:
authorzachs18 <8355914+zachs18@users.noreply.github.com>2024-07-05 16:45:03 -0500
committerGitHub <noreply@github.com>2024-07-05 16:45:03 -0500
commit9de76e3201a557f0ea9b076c8b38629c5f2b60d0 (patch)
tree30da429a34bdec8814df636cdc35e240bdafa239
parentb4149c6ad479cb35006355a1f1a3c0992a9f8b0e (diff)
downloadrust-9de76e3201a557f0ea9b076c8b38629c5f2b60d0.tar.gz
rust-9de76e3201a557f0ea9b076c8b38629c5f2b60d0.zip
Update library/std/src/sys/pal/common/exit_guard.rs
Co-authored-by: Ralf Jung <post@ralfj.de>
-rw-r--r--library/std/src/sys/pal/common/exit_guard.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/library/std/src/sys/pal/common/exit_guard.rs b/library/std/src/sys/pal/common/exit_guard.rs
index eb2c14cdecc..a1b0309b003 100644
--- a/library/std/src/sys/pal/common/exit_guard.rs
+++ b/library/std/src/sys/pal/common/exit_guard.rs
@@ -2,12 +2,14 @@ cfg_if::cfg_if! {
     if #[cfg(target_os = "linux")] {
         /// Mitigation for <https://github.com/rust-lang/rust/issues/126600>
         ///
-        /// On UNIX-like platforms (where `libc::exit` may not be thread-safe), ensure that only one
+        /// On glibc, `libc::exit` has been observed to not always be thread-safe.
+        /// It is currently unclear whether that is a glibc bug or allowed by the standard.
+        /// To mitigate this problem, we ensure that only one
         /// Rust thread calls `libc::exit` (or returns from `main`) by calling this function before
         /// calling `libc::exit` (or returning from `main`).
         ///
-        /// Technically not enough to ensure soundness, since other code directly calling
-        /// libc::exit will still race with this.
+        /// Technically, this is not enough to ensure soundness, since other code directly calling
+        /// `libc::exit` will still race with this.
         ///
         /// *This function does not itself call `libc::exit`.* This is so it can also be used
         /// to guard returning from `main`.