about summary refs log tree commit diff
path: root/library/std/src/sys/sync
diff options
context:
space:
mode:
authorjoboet <jonasboettiger@icloud.com>2024-11-30 16:22:56 +0100
committerjoboet <jonasboettiger@icloud.com>2024-11-30 16:22:56 +0100
commit8b2ff49ff9dd20ee417907c2e96daa9f0cd8e7c4 (patch)
tree592bc91bf8ee8e8b752dd9bf8ed959e293ef8e30 /library/std/src/sys/sync
parent528b37a738abf6cb0166fb60701dc2841ad54ebf (diff)
downloadrust-8b2ff49ff9dd20ee417907c2e96daa9f0cd8e7c4.tar.gz
rust-8b2ff49ff9dd20ee417907c2e96daa9f0cd8e7c4.zip
std: clarify comments about initialization
Diffstat (limited to 'library/std/src/sys/sync')
-rw-r--r--library/std/src/sys/sync/condvar/pthread.rs2
-rw-r--r--library/std/src/sys/sync/mutex/pthread.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/sys/sync/condvar/pthread.rs b/library/std/src/sys/sync/condvar/pthread.rs
index 4d2f9c0aaba..5bb7431eecf 100644
--- a/library/std/src/sys/sync/condvar/pthread.rs
+++ b/library/std/src/sys/sync/condvar/pthread.rs
@@ -22,7 +22,7 @@ impl Condvar {
     fn get(&self) -> Pin<&pal::Condvar> {
         self.cvar.get_or_init(|| {
             let mut cvar = Box::pin(pal::Condvar::new());
-            // SAFETY: we only call `init` once, namely here.
+            // SAFETY: we only call `init` once per `pal::Condvar`, namely here.
             unsafe { cvar.as_mut().init() };
             cvar
         })
diff --git a/library/std/src/sys/sync/mutex/pthread.rs b/library/std/src/sys/sync/mutex/pthread.rs
index 5719bb10f7f..75b4b9c6dad 100644
--- a/library/std/src/sys/sync/mutex/pthread.rs
+++ b/library/std/src/sys/sync/mutex/pthread.rs
@@ -21,7 +21,7 @@ impl Mutex {
         // This is sound however, as it cannot have been locked.
         self.pal.get_or_init(|| {
             let mut pal = Box::pin(pal::Mutex::new());
-            // SAFETY: we only call `init` once, namely here.
+            // SAFETY: we only call `init` once per `pal::Mutex`, namely here.
             unsafe { pal.as_mut().init() };
             pal
         })