Skip to content

Commit 860db17

Browse files
Yifan ZhuSchrodingerZhu
authored andcommitted
fix yet another bug
1 parent 05c5f98 commit 860db17

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

libc/src/__support/threads/linux/rwlock.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class WaitingQueue final : private RawMutex {
6565

6666
LIBC_INLINE constexpr Guard(WaitingQueue &queue, bool is_pshared)
6767
: queue(queue), is_pshared(is_pshared) {
68-
queue.lock();
68+
queue.lock(cpp::nullopt, is_pshared);
6969
}
7070

7171
public:
@@ -91,7 +91,6 @@ class WaitingQueue final : private RawMutex {
9191
reader_serialization(0), writer_serialization(0) {}
9292

9393
LIBC_INLINE Guard acquire(bool is_pshared) {
94-
this->lock();
9594
return Guard(*this, is_pshared);
9695
}
9796

libc/test/integration/src/pthread/pthread_rwlock_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ randomized_process_operation(SharedData &data,
350350
ASSERT_EQ(LIBC_NAMESPACE::pthread_create(
351351
&i, nullptr,
352352
[](void *arg) -> void * {
353-
for (int i = 0; i < 5; ++i)
353+
for (int i = 0; i < 10; ++i)
354354
randomized_thread_operation(
355355
reinterpret_cast<SharedData *>(arg));
356356
return nullptr;

0 commit comments

Comments
 (0)