Skip to content

Commit

Permalink
Fiddle with the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
thomcc committed Oct 8, 2020
1 parent f30cc74 commit e4cf24b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions library/std/src/sys/unix/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,11 @@ mod inner {
static INITIALIZED: AtomicBool = AtomicBool::new(false);
static INFO_BITS: AtomicU64 = AtomicU64::new(0);

// If a previous thread has filled in this global INITIALIZED, use that.
// If a previous thread has initialized `INFO_BITS`, use that.
if INITIALIZED.load(Ordering::Acquire) {
// The Acquire/Release pair used for INITIALIZED ensures that this
// load can see the corresponding `INFO_BITS` store, despite them
// both being Relaxed.
// Note: `Relaxed` is correct here and below -- the `Acquire` /
// `Release` pair used for `INITIALIZED` ensures this load can see
// the corresponding store below.
return info_from_bits(INFO_BITS.load(Ordering::Relaxed));
}

Expand All @@ -253,7 +253,7 @@ mod inner {
mach_timebase_info(&mut info);
}

// Note: This is racy, but the race is against other threads trying to
// This is racy, but the race should be against other threads trying to
// write the same value.
INFO_BITS.store(info_to_bits(info), Ordering::Relaxed);

Expand Down

0 comments on commit e4cf24b

Please sign in to comment.