Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions libc/src/__support/threads/linux/rwlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,9 @@ class RwLock {
public:
LIBC_INLINE constexpr RwLock(Role preference = Role::Reader,
bool is_pshared = false)
: is_pshared(is_pshared), preference(static_cast<unsigned>(preference)),
state(0), writer_tid(0), queue() {}
: is_pshared(is_pshared),
preference(static_cast<unsigned>(preference) & 1u), state(0),
writer_tid(0), queue() {}

[[nodiscard]]
LIBC_INLINE LockResult try_read_lock() {
Expand Down
1 change: 0 additions & 1 deletion libc/test/integration/src/pthread/pthread_rwlock_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include "src/unistd/fork.h"
#include "test/IntegrationTest/test.h"
#include <errno.h>
#include <optional>
#include <pthread.h>
#include <time.h>

Expand Down