Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 373746
b: refs/heads/master
c: f7dd1ce
h: refs/heads/master
v: v3
  • Loading branch information
Michel Lespinasse authored and Linus Torvalds committed May 7, 2013
1 parent edfa499 commit cbfdfa3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e2d57f782c8a906f80d5b5f54da803c1638929d7
refs/heads/master: f7dd1cee9a4e2b1450e4a3732636dfbf28562ee4
8 changes: 3 additions & 5 deletions trunk/lib/rwsem.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,12 @@ rwsem_down_failed_common(struct rw_semaphore *sem,
struct task_struct *tsk = current;
signed long count;

set_task_state(tsk, TASK_UNINTERRUPTIBLE);

/* set up my own style of waitqueue */
raw_spin_lock_irq(&sem->wait_lock);
waiter.task = tsk;
waiter.type = type;
get_task_struct(tsk);

raw_spin_lock_irq(&sem->wait_lock);
if (list_empty(&sem->wait_list))
adjustment += RWSEM_WAITING_BIAS;
list_add_tail(&waiter.list, &sem->wait_list);
Expand All @@ -218,7 +216,8 @@ rwsem_down_failed_common(struct rw_semaphore *sem,
raw_spin_unlock_irq(&sem->wait_lock);

/* wait to be given the lock */
for (;;) {
while (true) {
set_task_state(tsk, TASK_UNINTERRUPTIBLE);
if (!waiter.task)
break;

Expand All @@ -231,7 +230,6 @@ rwsem_down_failed_common(struct rw_semaphore *sem,
}
raw_spin_unlock_irq(&sem->wait_lock);
schedule();
set_task_state(tsk, TASK_UNINTERRUPTIBLE);
}

tsk->state = TASK_RUNNING;
Expand Down

0 comments on commit cbfdfa3

Please sign in to comment.