diff options
| author | Mike Makonnen <mtm@FreeBSD.org> | 2004-03-29 11:24:02 +0000 |
|---|---|---|
| committer | Mike Makonnen <mtm@FreeBSD.org> | 2004-03-29 11:24:02 +0000 |
| commit | 61bf8f47312dfa2d076b4a2f603129b03658a41c (patch) | |
| tree | 0835631c5f1441de6c10e9323ea4021eb6ec04ce /lib | |
| parent | 9b9a184d227615273f5581b063f340254c2f4fac (diff) | |
Notes
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libthr/thread/thr_cond.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libthr/thread/thr_cond.c b/lib/libthr/thread/thr_cond.c index 9292669d1c03..9597816f2f17 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); |
