Module Name: src Committed By: ad Date: Sat Jan 25 18:30:41 UTC 2020
Modified Files: src/lib/libpthread: pthread_mutex.c Log Message: Adjustment to previous: don't call _lwp_unpark_all() with nwaiters == 0. To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/lib/libpthread/pthread_mutex.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libpthread/pthread_mutex.c diff -u src/lib/libpthread/pthread_mutex.c:1.67 src/lib/libpthread/pthread_mutex.c:1.68 --- src/lib/libpthread/pthread_mutex.c:1.67 Sat Jan 25 17:58:28 2020 +++ src/lib/libpthread/pthread_mutex.c Sat Jan 25 18:30:41 2020 @@ -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 (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)); }