diff options
| author | Ralf Jung <post@ralfj.de> | 2024-10-25 12:01:08 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-10-25 12:02:47 +0200 |
| commit | 854e3c43e005c992542a80bea9bbe16230470362 (patch) | |
| tree | 8d818508ebc787af9adaf2df7eddc403594b5746 /library/std/src/sys/sync | |
| parent | 017ae1b21f7be6dcdcfc95631e54bde806653a8a (diff) | |
| download | rust-854e3c43e005c992542a80bea9bbe16230470362.tar.gz rust-854e3c43e005c992542a80bea9bbe16230470362.zip | |
library: consistently use American spelling for 'behavior'
Diffstat (limited to 'library/std/src/sys/sync')
| -rw-r--r-- | library/std/src/sys/sync/condvar/pthread.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/sync/mutex/pthread.rs | 4 | ||||
| -rw-r--r-- | library/std/src/sys/sync/once_box.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/sync/rwlock/futex.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/sync/rwlock/queue.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/sync/thread_parking/darwin.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/sync/thread_parking/pthread.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/sync/thread_parking/windows7.rs | 4 |
8 files changed, 10 insertions, 10 deletions
diff --git a/library/std/src/sys/sync/condvar/pthread.rs b/library/std/src/sys/sync/condvar/pthread.rs index 986cd0cb7d1..cee728e35cd 100644 --- a/library/std/src/sys/sync/condvar/pthread.rs +++ b/library/std/src/sys/sync/condvar/pthread.rs @@ -66,7 +66,7 @@ impl Drop for AllocatedCondvar { // On DragonFly pthread_cond_destroy() returns EINVAL if called on // a condvar that was just initialized with // libc::PTHREAD_COND_INITIALIZER. Once it is used or - // pthread_cond_init() is called, this behaviour no longer occurs. + // pthread_cond_init() is called, this behavior no longer occurs. debug_assert!(r == 0 || r == libc::EINVAL); } else { debug_assert_eq!(r, 0); diff --git a/library/std/src/sys/sync/mutex/pthread.rs b/library/std/src/sys/sync/mutex/pthread.rs index 87c95f45f96..abd58122523 100644 --- a/library/std/src/sys/sync/mutex/pthread.rs +++ b/library/std/src/sys/sync/mutex/pthread.rs @@ -65,7 +65,7 @@ impl Drop for AllocatedMutex { // On DragonFly pthread_mutex_destroy() returns EINVAL if called on a // mutex that was just initialized with libc::PTHREAD_MUTEX_INITIALIZER. // Once it is used (locked/unlocked) or pthread_mutex_init() is called, - // this behaviour no longer occurs. + // this behavior no longer occurs. debug_assert!(r == 0 || r == libc::EINVAL); } else { debug_assert_eq!(r, 0); @@ -88,7 +88,7 @@ impl Mutex { /// since the `lock` and the lock must have occurred on the current thread. /// /// # Safety - /// Causes undefined behaviour if the mutex is not locked. + /// Causes undefined behavior if the mutex is not locked. #[inline] pub(crate) unsafe fn get_assert_locked(&self) -> *mut libc::pthread_mutex_t { unsafe { self.inner.get_unchecked().0.get() } diff --git a/library/std/src/sys/sync/once_box.rs b/library/std/src/sys/sync/once_box.rs index 9d24db2245a..4105af50329 100644 --- a/library/std/src/sys/sync/once_box.rs +++ b/library/std/src/sys/sync/once_box.rs @@ -36,7 +36,7 @@ impl<T> OnceBox<T> { /// ``` /// /// # Safety - /// This causes undefined behaviour if the assumption above is violated. + /// This causes undefined behavior if the assumption above is violated. #[inline] pub unsafe fn get_unchecked(&self) -> &T { unsafe { &*self.ptr.load(Relaxed) } diff --git a/library/std/src/sys/sync/rwlock/futex.rs b/library/std/src/sys/sync/rwlock/futex.rs index df22c36dd5a..447048edf76 100644 --- a/library/std/src/sys/sync/rwlock/futex.rs +++ b/library/std/src/sys/sync/rwlock/futex.rs @@ -283,7 +283,7 @@ impl RwLock { futex_wake(&self.writer_notify) // Note that FreeBSD and DragonFlyBSD don't tell us whether they woke // up any threads or not, and always return `false` here. That still - // results in correct behaviour: it just means readers get woken up as + // results in correct behavior: it just means readers get woken up as // well in case both readers and writers were waiting. } diff --git a/library/std/src/sys/sync/rwlock/queue.rs b/library/std/src/sys/sync/rwlock/queue.rs index 733f51cae8c..889961915f4 100644 --- a/library/std/src/sys/sync/rwlock/queue.rs +++ b/library/std/src/sys/sync/rwlock/queue.rs @@ -8,7 +8,7 @@ //! * `pthread` is an external library, meaning the fast path of acquiring an //! uncontended lock cannot be inlined. //! * Some platforms (at least glibc before version 2.25) have buggy implementations -//! that can easily lead to undefined behaviour in safe Rust code when not properly +//! that can easily lead to undefined behavior in safe Rust code when not properly //! guarded against. //! * On some platforms (e.g. macOS), the lock is very slow. //! diff --git a/library/std/src/sys/sync/thread_parking/darwin.rs b/library/std/src/sys/sync/thread_parking/darwin.rs index 96e3d23c332..0553c5e19a9 100644 --- a/library/std/src/sys/sync/thread_parking/darwin.rs +++ b/library/std/src/sys/sync/thread_parking/darwin.rs @@ -5,7 +5,7 @@ //! rejection from the App Store). //! //! Therefore, we need to look for other synchronization primitives. Luckily, Darwin -//! supports semaphores, which allow us to implement the behaviour we need with +//! supports semaphores, which allow us to implement the behavior we need with //! only one primitive (as opposed to a mutex-condvar pair). We use the semaphore //! provided by libdispatch, as the underlying Mach semaphore is only dubiously //! public. diff --git a/library/std/src/sys/sync/thread_parking/pthread.rs b/library/std/src/sys/sync/thread_parking/pthread.rs index 5f195d0bb0c..76df73b2a8e 100644 --- a/library/std/src/sys/sync/thread_parking/pthread.rs +++ b/library/std/src/sys/sync/thread_parking/pthread.rs @@ -97,7 +97,7 @@ impl Parker { /// The constructed parker must never be moved. pub unsafe fn new_in_place(parker: *mut Parker) { // Use the default mutex implementation to allow for simpler initialization. - // This could lead to undefined behaviour when deadlocking. This is avoided + // This could lead to undefined behavior when deadlocking. This is avoided // by not deadlocking. Note in particular the unlocking operation before any // panic, as code after the panic could try to park again. (&raw mut (*parker).state).write(AtomicUsize::new(EMPTY)); diff --git a/library/std/src/sys/sync/thread_parking/windows7.rs b/library/std/src/sys/sync/thread_parking/windows7.rs index 8f7e66c46ef..f7585e882f0 100644 --- a/library/std/src/sys/sync/thread_parking/windows7.rs +++ b/library/std/src/sys/sync/thread_parking/windows7.rs @@ -35,7 +35,7 @@ // different implementations. // // Unfortunately, NT Keyed Events are an undocumented Windows API. However: -// - This API is relatively simple with obvious behaviour, and there are +// - This API is relatively simple with obvious behavior, and there are // several (unofficial) articles documenting the details. [1] // - `parking_lot` has been using this API for years (on Windows versions // before Windows 8). [2] Many big projects extensively use parking_lot, @@ -43,7 +43,7 @@ // - It is the underlying API used by Windows SRW locks and Windows critical // sections. [3] [4] // - The source code of the implementations of Wine, ReactOs, and Windows XP -// are available and match the expected behaviour. +// are available and match the expected behavior. // - The main risk with an undocumented API is that it might change in the // future. But since we only use it for older versions of Windows, that's not // a problem. |
