Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264367
b: refs/heads/master
c: f91f6cf
h: refs/heads/master
i:
  264365: 2908c87
  264363: 26ef541
  264359: 0589256
  264351: 1eec1f8
v: v3
  • Loading branch information
Linus Torvalds committed Oct 19, 2011
1 parent db2cfa7 commit cd25f3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 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: 5a6e8482a16e61250a9121fc9ec719ab0529e760
refs/heads/master: f91f6cfd4f9ea794dc3d0bbd54cb1d29d6ef3843
7 changes: 4 additions & 3 deletions trunk/kernel/posix-cpu-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,18 +274,19 @@ 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
* to synchronize the timer to the clock every time we start
* 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);
}
Expand Down

0 comments on commit cd25f3a

Please sign in to comment.