From 966e24104ae0700b8f7a1e8a0ab026c201c6354e Mon Sep 17 00:00:00 2001 From: Darren Hart Date: Fri, 3 Apr 2009 13:39:42 -0700 Subject: [PATCH] --- yaml --- r: 145857 b: refs/heads/master c: 4b1c486b3587d2abf50bee4a05eb488cd4045f2c h: refs/heads/master i: 145855: db7b2efbe4fae296dae2655d6ff0920b607fb931 v: v3 --- [refs] | 2 +- trunk/kernel/futex.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 4a4fda16a09a..f39f2097b6ef 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ca5f9524d61f54b1f618293ab92fc6b49cac864d +refs/heads/master: 4b1c486b3587d2abf50bee4a05eb488cd4045f2c diff --git a/trunk/kernel/futex.c b/trunk/kernel/futex.c index ebb48d6d1a87..421fb5e42a10 100644 --- a/trunk/kernel/futex.c +++ b/trunk/kernel/futex.c @@ -276,6 +276,25 @@ void put_futex_key(int fshared, union futex_key *key) drop_futex_key_refs(key); } +/** + * futex_top_waiter() - Return the highest priority waiter on a futex + * @hb: the hash bucket the futex_q's reside in + * @key: the futex key (to distinguish it from other futex futex_q's) + * + * Must be called with the hb lock held. + */ +static struct futex_q *futex_top_waiter(struct futex_hash_bucket *hb, + union futex_key *key) +{ + struct futex_q *this; + + plist_for_each_entry(this, &hb->chain, list) { + if (match_futex(&this->key, key)) + return this; + } + return NULL; +} + static u32 cmpxchg_futex_value_locked(u32 __user *uaddr, u32 uval, u32 newval) { u32 curval;