From 1905cf47bcfb53d9f7e640db83e43bbe32f9fa4a Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 10 Feb 2020 01:19:00 +0000 Subject: htl: Make joining self return EDEADLK --- htl/pt-join.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'htl') diff --git a/htl/pt-join.c b/htl/pt-join.c index 43878a3..ab77af5 100644 --- a/htl/pt-join.c +++ b/htl/pt-join.c @@ -30,6 +30,9 @@ __pthread_join (pthread_t thread, void **status) struct __pthread *pthread; int err = 0; + if (thread == pthread_self ()) + return EDEADLK; + /* Lookup the thread structure for THREAD. */ pthread = __pthread_getid (thread); if (pthread == NULL) -- cgit v1.1