]> sourceware.org Git - glibc.git/commitdiff
htl: make pthread_cond_destroy return EBUSY on waiters
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 9 Feb 2020 19:19:25 +0000 (19:19 +0000)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 9 Feb 2020 19:24:42 +0000 (19:24 +0000)
sysdeps/htl/pt-cond-destroy.c

index 62cc77b0d2088abd9b3cec79dbea41b0411b3c0c..b28e7e1ada350271a0e486ed65b9bb808e8f1938 100644 (file)
 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);
This page took 0.042582 seconds and 5 git commands to generate.