This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[hurd,commited 2/3] htl: make pthread_cond_destroy return EBUSY on waiters
- From: Samuel Thibault <samuel dot thibault at ens-lyon dot org>
- To: libc-alpha at sourceware dot org
- Cc: Samuel Thibault <samuel dot thibault at ens-lyon dot org>, commit-hurd at gnu dot org
- Date: Sun, 9 Feb 2020 20:27:49 +0100
- Subject: [hurd,commited 2/3] htl: make pthread_cond_destroy return EBUSY on waiters
- References: <20200209192750.292859-1-samuel.thibault@ens-lyon.org>
---
sysdeps/htl/pt-cond-destroy.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/sysdeps/htl/pt-cond-destroy.c b/sysdeps/htl/pt-cond-destroy.c
index 62cc77b0d2..b28e7e1ada 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);
--
2.24.1