diff options
| author | ad <ad@NetBSD.org> | 2020-01-25 18:30:41 +0000 |
|---|---|---|
| committer | ad <ad@NetBSD.org> | 2020-01-25 18:30:41 +0000 |
| commit | 788998405bca062ceec92f76e6a097f22f3fb4e7 (patch) | |
| tree | ea876ba53d884a897065bacbb11041b145989f6d /lib/libpthread | |
| parent | 0939ef02eb8be23df1a7e127e2da5a459c7d9b0b (diff) | |
Adjustment to previous: don't call _lwp_unpark_all() with nwaiters == 0.
Diffstat (limited to 'lib/libpthread')
| -rw-r--r-- | lib/libpthread/pthread_mutex.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libpthread/pthread_mutex.c b/lib/libpthread/pthread_mutex.c index 538d9f9a84f..45a9f9cb7aa 100644 --- a/lib/libpthread/pthread_mutex.c +++ b/lib/libpthread/pthread_mutex.c @@ -1,4 +1,4 @@ -/* $NetBSD: pthread_mutex.c,v 1.67 2020/01/25 17:58:28 ad Exp $ */ +/* $NetBSD: pthread_mutex.c,v 1.68 2020/01/25 18:30:41 ad Exp $ */ /*- * Copyright (c) 2001, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -47,7 +47,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: pthread_mutex.c,v 1.67 2020/01/25 17:58:28 ad Exp $"); +__RCSID("$NetBSD: pthread_mutex.c,v 1.68 2020/01/25 18:30:41 ad Exp $"); #include <sys/types.h> #include <sys/lwpctl.h> @@ -529,7 +529,7 @@ pthread__mutex_unlock_slow(pthread_mutex_t *ptm) (void)_lwp_unpark(self->pt_waiters[0], __UNVOLATILE(&ptm->ptm_waiters)); } - } else { + } else if (self->pt_nwaiters > 0) { (void)_lwp_unpark_all(self->pt_waiters, self->pt_nwaiters, __UNVOLATILE(&ptm->ptm_waiters)); } |
