From: Rich Salz Date: Thu, 10 Jun 2021 20:06:10 +0000 (-0400) Subject: Always wait for both threads to finish X-Git-Tag: openssl-3.0.0-beta1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3932c34cde5a152baeecd24d2395b4ad205a6d8;p=thirdparty%2Fopenssl.git Always wait for both threads to finish Reviewed-by: Tomas Mraz Reviewed-by: Richard Levitte Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/15708) --- diff --git a/test/threadstest.c b/test/threadstest.c index cb9817aa28a..ce31738189c 100644 --- a/test/threadstest.c +++ b/test/threadstest.c @@ -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);