patch-1.3.95 linux/kernel/sched.c
Next file: linux/lib/string.c
Previous file: linux/kernel/exit.c
Back to the patch index
Back to the overall index
- Lines: 51
- Date:
Tue Apr 23 11:23:26 1996
- Orig file:
v1.3.94/linux/kernel/sched.c
- Orig date:
Tue Apr 23 13:57:14 1996
diff -u --recursive --new-file v1.3.94/linux/kernel/sched.c linux/kernel/sched.c
@@ -546,40 +546,20 @@
int del_timer(struct timer_list * timer)
{
- unsigned long flags;
-#if SLOW_BUT_DEBUGGING_TIMERS
- struct timer_list * p;
-
- p = &timer_head;
- save_flags(flags);
- cli();
- while ((p = p->next) != &timer_head) {
- if (p == timer) {
- timer->next->prev = timer->prev;
- timer->prev->next = timer->next;
+ int ret = 0;
+ if (timer->next) {
+ unsigned long flags;
+ struct timer_list * next;
+ save_flags(flags);
+ cli();
+ if ((next = timer->next) != NULL) {
+ (next->prev = timer->prev)->next = next;
timer->next = timer->prev = NULL;
- restore_flags(flags);
- return 1;
+ ret = 1;
}
+ restore_flags(flags);
}
- if (timer->next || timer->prev)
- printk("del_timer() called from %p with timer not initialized\n",
- __builtin_return_address(0));
- restore_flags(flags);
- return 0;
-#else
- struct timer_list * next;
- int ret = 0;
- save_flags(flags);
- cli();
- if ((next = timer->next) != NULL) {
- (next->prev = timer->prev)->next = next;
- timer->next = timer->prev = NULL;
- ret = 1;
- }
- restore_flags(flags);
return ret;
-#endif
}
static inline void run_timer_list(void)
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this