Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7005
b: refs/heads/master
c: 6161b2c
h: refs/heads/master
i:
  7003: 98196e3
v: v3
  • Loading branch information
Pavel Machek authored and Linus Torvalds committed Sep 5, 2005
1 parent b965361 commit 7a22bd8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 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: 99dc7d63e0dcb457580241055b2a39d011309db8
refs/heads/master: 6161b2ce8116b9a623260ab811e2c035b3fac2e5
24 changes: 22 additions & 2 deletions trunk/kernel/power/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,33 @@ int freeze_processes(void)
} while_each_thread(g, p);
read_unlock(&tasklist_lock);
yield(); /* Yield is okay here */
if (time_after(jiffies, start_time + TIMEOUT)) {
if (todo && time_after(jiffies, start_time + TIMEOUT)) {
printk( "\n" );
printk(KERN_ERR " stopping tasks failed (%d tasks remaining)\n", todo );
return todo;
break;
}
} while(todo);

/* This does not unfreeze processes that are already frozen
* (we have slightly ugly calling convention in that respect,
* and caller must call thaw_processes() if something fails),
* but it cleans up leftover PF_FREEZE requests.
*/
if (todo) {
read_lock(&tasklist_lock);
do_each_thread(g, p)
if (freezing(p)) {
pr_debug(" clean up: %s\n", p->comm);
p->flags &= ~PF_FREEZE;
spin_lock_irqsave(&p->sighand->siglock, flags);
recalc_sigpending_tsk(p);
spin_unlock_irqrestore(&p->sighand->siglock, flags);
}
while_each_thread(g, p);
read_unlock(&tasklist_lock);
return todo;
}

printk( "|\n" );
BUG_ON(in_atomic());
return 0;
Expand Down

0 comments on commit 7a22bd8

Please sign in to comment.