summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_cond.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libthr/thread/thr_cond.c')
-rw-r--r--lib/libthr/thread/thr_cond.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libthr/thread/thr_cond.c b/lib/libthr/thread/thr_cond.c
index 9292669..9597816 100644
--- a/lib/libthr/thread/thr_cond.c
+++ b/lib/libthr/thread/thr_cond.c
@@ -147,8 +147,12 @@ _pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *cond_attr)
int
_pthread_cond_destroy(pthread_cond_t *cond)
{
- if (cond == NULL || *cond == NULL)
- return (EINVAL);
+ /*
+ * Short circuit for a statically initialized condvar
+ * that is being destroyed without having been used.
+ */
+ if (*cond == PTHREAD_COND_INITIALIZER)
+ return (0);
COND_LOCK(*cond);
OpenPOWER on IntegriCloud