diff options
author | Nicolas Pitre <nicolas.pitre@linaro.org> | 2011-10-19 14:22:34 -0400 |
---|---|---|
committer | Nicolas Pitre <nicolas.pitre@linaro.org> | 2011-10-19 14:22:34 -0400 |
commit | 2972bf78c18e5084a90980cbba106f53a09427ab (patch) | |
tree | e5c539f48d5e90132a8eb44c6ff04c324eac285e /kernel/posix-cpu-timers.c | |
parent | ed569f46a07bb2089138292df8faa8e3d583b577 (diff) | |
parent | e4fcd69c9e4e273352e0f87cabd9648606da0c3e (diff) |
Merge commit 'v3.1-rc10-9-ge4fcd69' into linaro-3.1linux-linaro-3.1-2011.10-0
Diffstat (limited to 'kernel/posix-cpu-timers.c')
-rw-r--r-- | kernel/posix-cpu-timers.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c index c8008dd58ef..640ded8f5c4 100644 --- a/kernel/posix-cpu-timers.c +++ b/kernel/posix-cpu-timers.c @@ -274,9 +274,7 @@ void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times) struct task_cputime sum; unsigned long flags; - spin_lock_irqsave(&cputimer->lock, flags); if (!cputimer->running) { - cputimer->running = 1; /* * The POSIX timer interface allows for absolute time expiry * values through the TIMER_ABSTIME flag, therefore we have @@ -284,8 +282,11 @@ void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times) * it. */ thread_group_cputime(tsk, &sum); + spin_lock_irqsave(&cputimer->lock, flags); + cputimer->running = 1; update_gt_cputime(&cputimer->cputime, &sum); - } + } else + spin_lock_irqsave(&cputimer->lock, flags); *times = cputimer->cputime; spin_unlock_irqrestore(&cputimer->lock, flags); } |