htl: Make joining self return EDEADLK

This commit is contained in:
Samuel Thibault 2020-02-10 01:19:00 +00:00
parent 6acd77229a
commit 1905cf47bc
1 changed files with 3 additions and 0 deletions

View File

@ -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)