From: Samuel Thibault Date: Sun, 9 Feb 2020 19:19:25 +0000 (+0000) Subject: htl: make pthread_cond_destroy return EBUSY on waiters X-Git-Tag: glibc-2.32~711 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=faae4b2bdd692d929037c80c3315f716f02f3b00;p=thirdparty%2Fglibc.git htl: make pthread_cond_destroy return EBUSY on waiters --- diff --git a/sysdeps/htl/pt-cond-destroy.c b/sysdeps/htl/pt-cond-destroy.c index 62cc77b0d20..b28e7e1ada3 100644 --- a/sysdeps/htl/pt-cond-destroy.c +++ b/sysdeps/htl/pt-cond-destroy.c @@ -22,7 +22,14 @@ int __pthread_cond_destroy (pthread_cond_t *cond) { - return 0; + int ret = 0; + + __pthread_spin_lock (&cond->__lock); + if (cond->__queue) + ret = EBUSY; + __pthread_spin_unlock (&cond->__lock); + + return ret; } strong_alias (__pthread_cond_destroy, pthread_cond_destroy);