Skip to content

Commit

Permalink
Fixes llvm#118231: Corrected spelling mistake in has_acitive_owner fu…
Browse files Browse the repository at this point in the history
…nction (llvm#118266)

Fixes llvm#118231 
- Updated the method name to `has_active_owner` in
`llvm-project/libc/src/__support/threads/linux/rwlock.h`
- Verified usage and updated all references to the method.
- Ran tests:
    - `check-llvm-unit`
    - `check-all`
  • Loading branch information
firestrike007 authored Dec 2, 2024
1 parent 08c1a6b commit eaa6cc5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libc/src/__support/threads/linux/rwlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class RwState {
LIBC_INLINE constexpr bool has_active_reader() const {
return state >= ACTIVE_READER_COUNT_UNIT;
}
LIBC_INLINE constexpr bool has_acitve_owner() const {
LIBC_INLINE constexpr bool has_active_owner() const {
return has_active_reader() || has_active_writer();
}
LIBC_INLINE constexpr bool has_last_reader() const {
Expand Down Expand Up @@ -193,7 +193,7 @@ class RwState {
}
__builtin_unreachable();
} else
return !has_acitve_owner();
return !has_active_owner();
}

// This function check if it is possible to grow the reader count without
Expand Down Expand Up @@ -548,7 +548,7 @@ class RwLock {
[[nodiscard]]
LIBC_INLINE LockResult check_for_destroy() {
RwState old = RwState::load(state, cpp::MemoryOrder::RELAXED);
if (old.has_acitve_owner())
if (old.has_active_owner())
return LockResult::Busy;
return LockResult::Success;
}
Expand Down

0 comments on commit eaa6cc5

Please sign in to comment.