From b983f86371c577b30593d06877c0084bf1bdbb6b Mon Sep 17 00:00:00 2001 From: limeng151 Date: Wed, 2 Jun 2021 17:11:12 +0800 Subject: [PATCH] limeng151@huawei.com Signed-off-by: limeng151 Change-Id: Ib2cd5795a070fd54f38b70d57c0389109064a861 --- .../futex_posix/src/PthreadCondTest.cpp | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/kernel_lite/futex_posix/src/PthreadCondTest.cpp b/kernel_lite/futex_posix/src/PthreadCondTest.cpp index d8e925743..5b71fddf3 100755 --- a/kernel_lite/futex_posix/src/PthreadCondTest.cpp +++ b/kernel_lite/futex_posix/src/PthreadCondTest.cpp @@ -144,8 +144,8 @@ HWTEST_F(FutexTest, testPthreadCondSignalBefore, Function | MediumTest | Level3) ASSERT_EQ(pthread_create(&tid[1], nullptr, ThreadPthreadCondSignalBefore2, nullptr), 0) << "> return errno"; Msleep(100); - pthread_cancel(tid[0]); - pthread_cancel(tid[1]); + pthread_join(tid[0], nullptr); + pthread_join(tid[1], nullptr); EXPECT_EQ(pthread_cond_destroy(&g_cond1), 0); EXPECT_EQ(pthread_mutex_destroy(&g_mtx1), 0); EXPECT_EQ(CheckStep(5), (uint64_t)0x12345); @@ -189,8 +189,8 @@ HWTEST_F(FutexTest, testPthreadCondSignalAfter, Function | MediumTest | Level3) ASSERT_EQ(pthread_create(&tid[1], nullptr, ThreadTestCondSignalWaitAfter2, nullptr), 0) << "> return errno"; Msleep(100); - pthread_cancel(tid[0]); - pthread_cancel(tid[1]); + pthread_join(tid[0], nullptr); + pthread_join(tid[1], nullptr); EXPECT_EQ(pthread_cond_destroy(&g_cond2), 0); EXPECT_EQ(pthread_mutex_destroy(&g_mtx2), 0); EXPECT_EQ(CheckStep(4), (uint64_t)0x1234); @@ -237,9 +237,9 @@ HWTEST_F(FutexTest, testPthreadCondBroadcast, Function | MediumTest | Level3) ASSERT_EQ(pthread_create(&tid[2], nullptr, ThreadPthreadCondBroadcast2, (void*)&testInt), 0) << "> return errno"; Msleep(100); - pthread_cancel(tid[0]); - pthread_cancel(tid[1]); - pthread_cancel(tid[2]); + pthread_join(tid[0], nullptr); + pthread_join(tid[1], nullptr); + pthread_join(tid[2], nullptr); EXPECT_EQ(pthread_cond_destroy(&g_cond3), 0); EXPECT_EQ(pthread_mutex_destroy(&g_mtx3), 0); EXPECT_EQ(testInt, 12); @@ -292,8 +292,8 @@ HWTEST_F(FutexTest, testPthreadCondTimedwait, Function | MediumTest | Level3) ASSERT_EQ(pthread_create(&tid2, nullptr, ThreadPthreadCondTimedwait2, nullptr), 0) << "> return errno"; Msleep(100); - pthread_cancel(tid1); - pthread_cancel(tid2); + pthread_join(tid1, nullptr); + pthread_join(tid2, nullptr); EXPECT_EQ(pthread_cond_destroy(&g_cond4), 0); EXPECT_EQ(pthread_mutex_destroy(&g_mtx4), 0); EXPECT_EQ(CheckStep(4), (uint64_t)0x1234); @@ -335,7 +335,7 @@ HWTEST_F(FutexTest, testPthreadCondTimedwaitOut, Function | MediumTest | Level3) ASSERT_EQ(pthread_create(&tid, nullptr, ThreadPthreadCondTimedwaitOut, nullptr), 0) << "> return errno"; Msleep(200); - pthread_cancel(tid); + pthread_join(tid, nullptr); EXPECT_EQ(pthread_cond_destroy(&g_cond5), 0); EXPECT_EQ(pthread_mutex_destroy(&g_mtx5), 0); EXPECT_EQ(CheckStep(3), (uint64_t)0x123); @@ -373,7 +373,7 @@ HWTEST_F(FutexTest, testPthreadCondTimedwaitEinval, Function | MediumTest | Leve ASSERT_EQ(pthread_create(&tid, nullptr, ThreadPthreadCondTimedwaitEinval, nullptr), 0) << "> return errno"; Msleep(200); - pthread_cancel(tid); + pthread_join(tid, nullptr); EXPECT_EQ(pthread_cond_destroy(&g_cond6), 0); EXPECT_EQ(pthread_mutex_destroy(&g_mtx6), 0); EXPECT_EQ(CheckStep(3), (uint64_t)0x123); -- GitLab