In message <200005111309.RAA32574@xxxxxxxxxxxxx> you write:
> Actually, existing *_timer primitives are very inconvenient.
> And I did not find any good way to improve them. Essentially,
> del_timer_sync(), timer->running and mod_timer() returning
> value are all that I was able to do.
There's still a tiny race with unloading modules between timer_exit()
and return in the timer handler.
A better interface would be to make the timerfn return a pointer to
the timer:
struct timer_list *function(unsigned long data);
Get rid of the braindead timer_exit() macro, and inside
run_timer_list, do:
#ifdef CONFIG_SMP
if (timer->function(timer->data)) {
timer->running = 0;
mb();
}
#else
timer->function(timer->data);
#endif
Then del_timer_sync() becomes the default, and del_timer_async() is
used for self-deleting timers and special effects.
(BTW, returning a pointer not an int so bugs like `kfree(timer);
return timer;' are more obvious).
So can we live with the current braindeath in 2.4?
Rusty.
--
Hacking time.
|