Skip to content

Commit b443711

Browse files
authored
[rtsan] Ensure pthread is initialized in test (#111401)
Handle running stuck of `pthread_cond_destroy` on X86 in test `PthreadCondSignalDiesWhenRealtime` and `PthreadCondBroadcastDiesWhenRealtime`.
1 parent 63a0a81 commit b443711

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler-rt/lib/rtsan/tests/rtsan_test_interceptors.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ TEST(TestRtsanInterceptors, SpinLockLockDiesWhenRealtime) {
539539

540540
TEST(TestRtsanInterceptors, PthreadCondSignalDiesWhenRealtime) {
541541
pthread_cond_t cond{};
542-
pthread_cond_init(&cond, NULL);
542+
ASSERT_EQ(0, pthread_cond_init(&cond, nullptr));
543543

544544
auto Func = [&cond]() { pthread_cond_signal(&cond); };
545545
ExpectRealtimeDeath(Func, "pthread_cond_signal");
@@ -550,7 +550,7 @@ TEST(TestRtsanInterceptors, PthreadCondSignalDiesWhenRealtime) {
550550

551551
TEST(TestRtsanInterceptors, PthreadCondBroadcastDiesWhenRealtime) {
552552
pthread_cond_t cond{};
553-
pthread_cond_init(&cond, NULL);
553+
ASSERT_EQ(0, pthread_cond_init(&cond, nullptr));
554554

555555
auto Func = [&cond]() { pthread_cond_broadcast(&cond); };
556556
ExpectRealtimeDeath(Func, "pthread_cond_broadcast");

0 commit comments

Comments
 (0)