test: threads: replace test_thread_noreturn
authorČestmír Kalina <ckalina@redhat.com>
Fri, 21 Oct 2022 09:08:24 +0000 (11:08 +0200)
committerTomas Mraz <tomas@openssl.org>
Fri, 21 Oct 2022 10:44:56 +0000 (12:44 +0200)
commit6ca4bd2e4c92531e74acba3e1ff08e6fbb664b20
treee75a640d2bc33ee8c1bbb578ad5961310f1385b1
parent4e43bc06f7673597a99f61325543449e72070c8c
test: threads: replace test_thread_noreturn

While POSIX threads are cancellable and may be asynchronously cancelled,
their cancellation is not guaranteed by the POSIX standard.

test_thread_noreturn, which simulates a long-running possibly
unresponsive thread:

THREAD #1 THREAD #2
LOCK L1
SPAWN #2
LOCK L1

On MacOS, cancelling such thread only queues cancellation request, but
the following pthread_join hangs.

Replace this implementation by an unbounded sequence of sleeps instead.

Signed-off-by: Čestmír Kalina <ckalina@redhat.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19433)
test/threadstest.c