aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Leidinger <netchild@FreeBSD.org>2006-09-09 13:04:28 +0000
committerAlexander Leidinger <netchild@FreeBSD.org>2006-09-09 13:04:28 +0000
commitc19ddeda0746b21f66728123a34458175de2deb4 (patch)
tree5e31825b36e4b0a678a81eaaf60e293e62b8d006
parentaf8bc757deb269dcd8d7a897a2737a4e8d83f4f8 (diff)
downloadsrc-c19ddeda0746b21f66728123a34458175de2deb4.tar.gz
src-c19ddeda0746b21f66728123a34458175de2deb4.zip
- don't wake every sleeper just the first one [1]
- remove debuging printf [2] Submitted by: intron <mag@intron.ac> [1], rdivacky [2]
Notes
Notes: svn path=/head/; revision=162179
-rw-r--r--sys/compat/linux/linux_futex.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c
index 8e3b168db113..513c42dd1d1d 100644
--- a/sys/compat/linux/linux_futex.c
+++ b/sys/compat/linux/linux_futex.c
@@ -302,9 +302,6 @@ linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args)
ret = futex_wake(f, args->val, NULL);
futex_put(f);
if (op_ret > 0) {
-#ifdef DEBUG
- printf("second wakeup\n");
-#endif
op_ret = 0;
/*
* Linux uses the address of the timespec parameter
@@ -421,13 +418,13 @@ futex_wake(struct futex *f, int n, struct futex *newf)
FUTEX_LOCK;
TAILQ_FOREACH(wp, &f->f_waiting_proc, wp_list) {
if (count <= n) {
- wakeup(wp);
+ wakeup_one(wp);
count++;
} else {
if (newf != NULL) {
/* futex_put called after tsleep */
wp->wp_new_futex = futex_get(newf->f_uaddr, FUTEX_LOCKED);
- wakeup(wp);
+ wakeup_one(wp);
}
}
}