summaryrefslogtreecommitdiff
path: root/lib/libpthread
diff options
context:
space:
mode:
authorad <ad@NetBSD.org>2007-01-16 01:35:16 +0000
committerad <ad@NetBSD.org>2007-01-16 01:35:16 +0000
commit39aa27f5cede714728b46d9be48b71ee142318f7 (patch)
treeb5e38c1f2e16f8963fe52f1d7042e87a5331a3ff /lib/libpthread
parent2ec3e26f2115c046c6030a91f337a4b89a53a9b1 (diff)
Pass in the 'hint' argument when parking/unparking LWPs.
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/pthread.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/libpthread/pthread.c b/lib/libpthread/pthread.c
index f678778c561..b62d65e4167 100644
--- a/lib/libpthread/pthread.c
+++ b/lib/libpthread/pthread.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread.c,v 1.52 2006/12/24 18:39:45 ad Exp $ */
+/* $NetBSD: pthread.c,v 1.53 2007/01/16 01:35:16 ad Exp $ */
/*-
* Copyright (c) 2001, 2002, 2003, 2006 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread.c,v 1.52 2006/12/24 18:39:45 ad Exp $");
+__RCSID("$NetBSD: pthread.c,v 1.53 2007/01/16 01:35:16 ad Exp $");
#include <err.h>
#include <errno.h>
@@ -191,7 +191,7 @@ pthread_init(void)
pthread__nspins = PTHREAD__NSPINS;
else
pthread__nspins = 1;
- i = _lwp_unpark_all(NULL, 0);
+ i = _lwp_unpark_all(NULL, 0, NULL);
if (i < pthread__unpark_max)
pthread__unpark_max = i;
#endif
@@ -712,6 +712,7 @@ pthread_exit(void *retval)
pthread_spinunlock(self, &pthread__allqueue_lock);
#else
pthread_spinunlock(self, &pthread__deadqueue_lock);
+ /* XXXLWP race against stack being reclaimed. */
_lwp_exit();
#endif
} else {
@@ -1376,7 +1377,7 @@ pthread__park(pthread_t self, pthread_spin_t *lock,
rv = 0;
do {
pthread_spinunlock(self, lock);
- if (_lwp_park((const void *)abstime, NULL) != 0) {
+ if (_lwp_park(abstime, NULL, obj) != 0) {
switch (rv = errno) {
case EINTR:
/* Check for cancellation. */
@@ -1429,7 +1430,7 @@ pthread__unpark(pthread_t self, pthread_spin_t *lock, void *obj,
target->pt_sleepobj = NULL;
target->pt_sleeponq = 0;
pthread_spinunlock(self, lock);
- rv = _lwp_unpark(target->pt_lid);
+ rv = _lwp_unpark(target->pt_lid, obj);
if (rv != 0 && errno != EALREADY && errno != EINTR) {
SDPRINTF(("(pthread__unpark %p) syscall rv=%d\n",
@@ -1498,7 +1499,7 @@ pthread__unpark_all(pthread_t self, pthread_spin_t *lock, void *obj,
case 0:
return;
case 1:
- rv = _lwp_unpark(waiters[0]);
+ rv = _lwp_unpark(waiters[0], obj);
if (rv != 0 && errno != EALREADY && errno != EINTR) {
OOPS("_lwp_unpark failed");
SDPRINTF(("(pthread__unpark_all %p) "
@@ -1506,7 +1507,7 @@ pthread__unpark_all(pthread_t self, pthread_spin_t *lock, void *obj,
}
return;
default:
- rv = _lwp_unpark_all(waiters, n);
+ rv = _lwp_unpark_all(waiters, n, obj);
if (rv != 0 && errno != EINTR) {
OOPS("_lwp_unpark_all failed");
SDPRINTF(("(pthread__unpark_all %p) "