Skip to content

Commit

Permalink
Always wait for both threads to finish
Browse files Browse the repository at this point in the history
Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Richard Levitte <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
(Merged from openssl#15708)
  • Loading branch information
richsalz authored and mattcaswell committed Jun 16, 2021
1 parent 218e996 commit c3932c3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/threadstest.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,16 @@ static int test_multi(int idx)

worker();

if (!TEST_true(wait_for_thread(thread1))
|| !TEST_true(wait_for_thread(thread2))
|| !TEST_true(multi_success))
goto err;

testresult = 1;
/*
* Don't combine these into one if statement; must wait for both threads.
*/
if (!TEST_true(wait_for_thread(thread1)))
testresult = 0;
if (!TEST_true(wait_for_thread(thread2)))
testresult = 0;
if (!TEST_true(multi_success))
testresult = 0;

err:
EVP_MD_free(sha256);
Expand Down

0 comments on commit c3932c3

Please sign in to comment.