Skip to content

Commit 0b12cd2

Browse files
authored
[rtsan] Ensure pthread is initialized in test (#108040)
1 parent 61372fc commit 0b12cd2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,12 @@ TEST_F(PthreadMutexLockTest, PthreadMutexUnlockSurvivesWhenNotRealtime) {
472472
ExpectNonRealtimeSurvival(Func);
473473
}
474474

475-
TEST(TestRtsanInterceptors, PthreadMutexJoinDiesWhenRealtime) {
476-
auto Func = []() {
477-
pthread_t thread{};
478-
pthread_join(thread, nullptr);
479-
};
475+
TEST(TestRtsanInterceptors, PthreadJoinDiesWhenRealtime) {
476+
pthread_t thread{};
477+
ASSERT_EQ(0,
478+
pthread_create(&thread, nullptr, &FakeThreadEntryPoint, nullptr));
479+
480+
auto Func = [&thread]() { pthread_join(thread, nullptr); };
480481

481482
ExpectRealtimeDeath(Func, "pthread_join");
482483
ExpectNonRealtimeSurvival(Func);

0 commit comments

Comments
 (0)