Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 116365
b: refs/heads/master
c: 31d9284
h: refs/heads/master
i:
  116363: 0d7a377
v: v3
  • Loading branch information
Oleg Nesterov authored and Thomas Gleixner committed Sep 24, 2008
1 parent f8101da commit cb3b321
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 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: 5a51b713ccf8835d5adf7217e2f86eb12b1ca851
refs/heads/master: 31d9284569e38fb97117497af3e8047a6a3c86f0
23 changes: 10 additions & 13 deletions trunk/kernel/posix-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,31 +556,28 @@ sys_timer_create(const clockid_t which_clock,
* the find to the timer lock. To avoid a dead lock, the timer id MUST
* be release with out holding the timer lock.
*/
static struct k_itimer * lock_timer(timer_t timer_id, unsigned long *flags)
static struct k_itimer *lock_timer(timer_t timer_id, unsigned long *flags)
{
struct k_itimer *timr;
/*
* Watch out here. We do a irqsave on the idr_lock and pass the
* flags part over to the timer lock. Must not let interrupts in
* while we are moving the lock.
*/

spin_lock_irqsave(&idr_lock, *flags);
timr = idr_find(&posix_timers_id, (int) timer_id);
timr = idr_find(&posix_timers_id, (int)timer_id);
if (timr) {
spin_lock(&timr->it_lock);

if (!timr->it_process ||
!same_thread_group(timr->it_process, current)) {
spin_unlock(&timr->it_lock);
spin_unlock_irqrestore(&idr_lock, *flags);
timr = NULL;
} else
if (timr->it_process &&
same_thread_group(timr->it_process, current)) {
spin_unlock(&idr_lock);
} else
spin_unlock_irqrestore(&idr_lock, *flags);
return timr;
}
spin_unlock(&timr->it_lock);
}
spin_unlock_irqrestore(&idr_lock, *flags);

return timr;
return NULL;
}

/*
Expand Down

0 comments on commit cb3b321

Please sign in to comment.