Skip to content

Commit

Permalink
chore: Fix typos (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
jayvdb authored Sep 13, 2024
1 parent 8717b76 commit 9963923
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ impl<T: ?Sized> RwLock<T> {
self.read().wait()
}

/// Attempts to acquire a read lock with the possiblity to upgrade to a write lock.
/// Attempts to acquire a read lock with the possibility to upgrade to a write lock.
///
/// If a read lock could not be acquired at this time, then [`None`] is returned. Otherwise, a
/// guard is returned that releases the lock when dropped.
Expand Down Expand Up @@ -315,7 +315,7 @@ impl<T: ?Sized> RwLock<T> {
}
}

/// Acquires a read lock with the possiblity to upgrade to a write lock.
/// Acquires a read lock with the possibility to upgrade to a write lock.
///
/// Returns a guard that releases the lock when dropped.
///
Expand Down Expand Up @@ -346,7 +346,7 @@ impl<T: ?Sized> RwLock<T> {
UpgradableRead::new(self.raw.upgradable_read(), self.value.get())
}

/// Attempts to acquire a read lock with the possiblity to upgrade to a write lock.
/// Attempts to acquire a read lock with the possibility to upgrade to a write lock.
///
/// Returns a guard that releases the lock when dropped.
///
Expand Down Expand Up @@ -386,7 +386,7 @@ impl<T: ?Sized> RwLock<T> {
}

/// Attempts to acquire an owned, reference-counted read lock
/// with the possiblity to upgrade to a write lock.
/// with the possibility to upgrade to a write lock.
///
/// Returns a guard that releases the lock when dropped.
///
Expand Down Expand Up @@ -426,7 +426,7 @@ impl<T: ?Sized> RwLock<T> {
self.upgradable_read_arc().wait()
}

/// Attempts to acquire an owned, reference-counted read lock with the possiblity to
/// Attempts to acquire an owned, reference-counted read lock with the possibility to
/// upgrade to a write lock.
///
/// If a read lock could not be acquired at this time, then [`None`] is returned. Otherwise, a
Expand Down Expand Up @@ -461,7 +461,7 @@ impl<T: ?Sized> RwLock<T> {
}
}

/// Acquires an owned, reference-counted read lock with the possiblity
/// Acquires an owned, reference-counted read lock with the possibility
/// to upgrade to a write lock.
///
/// Returns a guard that releases the lock when dropped.
Expand Down
6 changes: 3 additions & 3 deletions src/rwlock/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl RawRwLock {
}
}

/// Returs `true` iff a write lock was successfully acquired.
/// Returns `true` iff a write lock was successfully acquired.
pub(super) fn try_write(&self) -> bool {
// First try grabbing the mutex.
Expand Down Expand Up @@ -207,7 +207,7 @@ impl RawRwLock {
/// # Safety
///
/// Caller must hold an upgradable read lock.
/// This will downgrade it to a stadard read lock.
/// This will downgrade it to a standard read lock.
#[inline]

pub(super) unsafe fn downgrade_upgradable_read(&self) {
Expand Down Expand Up @@ -421,7 +421,7 @@ pin_project_lite::pin_project! {
// Our listener for the "no readers" event.
no_readers: Option<EventListener>,

// Current state fof this future.
// Current state of this future.
#[pin]
state: WriteState<'a>,
}
Expand Down
4 changes: 2 additions & 2 deletions tests/barrier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn smoke() {
}

// At this point, all spawned threads should be blocked,
// so we shouldn't get anything from the cahnnel.
// so we shouldn't get anything from the channel.
let res = rx.try_recv();
assert!(res.is_err());

Expand Down Expand Up @@ -69,7 +69,7 @@ fn smoke_blocking() {
}

// At this point, all spawned threads should be blocked,
// so we shouldn't get anything from the cahnnel.
// so we shouldn't get anything from the channel.
let res = rx.try_recv();
assert!(res.is_err());

Expand Down
2 changes: 1 addition & 1 deletion tests/loom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn barrier_smoke() {
}

// At this point, all spawned threads should be blocked,
// so we shouldn't get anything from the cahnnel.
// so we shouldn't get anything from the channel.
let res = rx.try_recv();
assert!(res.is_err());

Expand Down

0 comments on commit 9963923

Please sign in to comment.