DEL_TIMER_SYNC(9) Driver Basics DEL_TIMER_SYNC(9)NAME
del_timer_sync - deactivate a timer and wait for the handler to finish.
int del_timer_sync(struct timer_list * timer);
the timer to be deactivated
This function only differs from del_timer on SMP: besides deactivating the timer it also makes sure the handler has finished executing on
Callers must prevent restarting of the timer, otherwise this function is meaningless. It must not be called from interrupt contexts unless
the timer is an irqsafe one. The caller must not hold locks which would prevent completion of the timer's handler. The timer's handler must
not call add_timer_on. Upon exit the timer is not queued and the handler is not running on any CPU.
For !irqsafe timers, you must not hold locks that are held in interrupt context while calling this function. Even if the lock has nothing
to do with the timer in question. Here's why:
CPU0 CPU1 ---- ---- <SOFTIRQ> call_timer_fn; base->running_timer = mytimer; spin_lock_irq(somelock); <IRQ> spin_lock(somelock);
del_timer_sync(mytimer); while (base->running_timer == mytimer);
Now del_timer_sync will never return and never release somelock. The interrupt on the other CPU is waiting to grab somelock but it has
interrupted the softirq that CPU0 is waiting to finish.
The function returns whether it has deactivated a pending timer or not.
COPYRIGHT Kernel Hackers Manual 3.10 June 2014 DEL_TIMER_SYNC(9)
Check Out this Related Man Page
mktimer - allocate a per-process timer
The function is used to allocate a per-process timer using the specified system-wide clock as the timing base. returns an unique timer ID
of type used to identify the timer in timer requests (see gettimer(3C)). specifies the system-wide clock to be used as the timing base for
the new timer. specifies the mechanism by which the process is to be notified when the timer expires.
supports one per-process timer with a of and of
If is the system causes a signal to be sent to the process whenever the timer expires.
For the machine-dependent clock resolution and maximum value are and seconds, respectively. These constants are defined in
Upon successful completion, returns a which can be passed to the per_process timer calls. If unsuccessful, returns a value of and sets to
indicate the error.
fails if any of the following conditions are encountered:
[EAGAIN] The calling process has already allocated all of the timers it is allowed.
[EINVAL] is not defined, or does not allow the specified notification mechanism.
timers(2), getclock(3C), gettimer(3C), reltimer(3C), rmtimer(3C), setclock(3C), thread_safety(5).
STANDARDS CONFORMANCE mktimer(3C)
9 More Discussions You Might Find Interesting
1. Post Here to Contact Site Administrators and Moderators
can u please shorten the reply timer to like 1 min or so. It is prolly just me but i end up passing on replying to posts due to i hate waiting for my timer to reset w/ a 2.5 mins wait. (2 Replies)
Wanted to a create a shell script
1) which when called will start a timer and wait for 48 hours.
after 48 hours it will call some function(say XYZ)
2) Whenever this shell script is called (can be called... (3 Replies)
I have questions about timer function in multi-threads environment.
My application has multi-threads, in one thread, I set a timer, when the timer expires, the timer function will interrupt other thread and execute.
I am not clear which thread will be interrupted by the timer function ?... (2 Replies)
:eek: I use this Solaris to run CMS a call acounting software package for my job. No one could run reports today because it said the this when you logged on
"The following file systems are low, and could adversely affect server performance:
File system /: 99%full"
Can some one please explain... (9 Replies)
my pc has two CPU, so CPU1 and CPU2.
I have a perl "a.pl", when i "./a.pl", i can see the CPU1 is full or CPU2 is full, mean only one is full, another one is idle.
Wonderring what shall i do in order to let both CPU to process this a.pl.:(
Thanks (1 Reply)