All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] crypto/af_alg02: use pthread_tryjoin_np() instead of pthread_kill()
@ 2021-07-15 10:28 Alexey Kodanev
  2021-07-16  7:06 ` Li Wang
  0 siblings, 1 reply; 8+ messages in thread
From: Alexey Kodanev @ 2021-07-15 10:28 UTC (permalink / raw)
  To: ltp

musl doesn't return ESRCH for pthread_kill() if thread id is not found.

POSIX only recommends to return ESRCH, and also says that pthread_kill()
produces undefined behavior if tid lifetime has ended [1].

[1]: https://man7.org/linux/man-pages/man3/pthread_kill.3.html

Signed-off-by: Alexey Kodanev <aleksei.kodanev@bell-sw.com>
---
 testcases/kernel/crypto/af_alg02.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/crypto/af_alg02.c b/testcases/kernel/crypto/af_alg02.c
index 31d30777c..0f5793c16 100644
--- a/testcases/kernel/crypto/af_alg02.c
+++ b/testcases/kernel/crypto/af_alg02.c
@@ -60,7 +60,7 @@ static void run(void)
 
 	TST_CHECKPOINT_WAIT(0);
 
-	while (pthread_kill(thr, 0) != ESRCH) {
+	while (pthread_tryjoin_np(thr, NULL) == EBUSY) {
 		if (tst_timeout_remaining() <= 10) {
 			pthread_cancel(thr);
 			tst_brk(TBROK,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-07-16 13:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 10:28 [LTP] [PATCH] crypto/af_alg02: use pthread_tryjoin_np() instead of pthread_kill() Alexey Kodanev
2021-07-16  7:06 ` Li Wang
2021-07-16  9:51   ` Petr Vorel
2021-07-16 12:12     ` Alexey Kodanev
2021-07-16 12:03   ` Alexey Kodanev
2021-07-16 13:12     ` Li Wang
2021-07-16 13:21       ` Li Wang
2021-07-16 13:35         ` Alexey Kodanev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.