mirror of https://github.com/ipxe/ipxe.git
[retry] Add start_timer_fixed()
Allow for timers to be started with fixed timeouts.pull/1/head
parent
3a2c8a2690
commit
32e8ab4df0
|
@ -35,9 +35,21 @@ struct retry_timer {
|
|||
};
|
||||
|
||||
extern void start_timer ( struct retry_timer *timer );
|
||||
extern void start_timer_nodelay ( struct retry_timer *timer );
|
||||
extern void start_timer_fixed ( struct retry_timer *timer,
|
||||
unsigned long timeout );
|
||||
extern void stop_timer ( struct retry_timer *timer );
|
||||
|
||||
/**
|
||||
* Start timer with no delay
|
||||
*
|
||||
* @v timer Retry timer
|
||||
*
|
||||
* This starts the timer running with a zero timeout value.
|
||||
*/
|
||||
static inline void start_timer_nodelay ( struct retry_timer *timer ) {
|
||||
start_timer_fixed ( timer, 0 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Test to see if timer is currently running
|
||||
*
|
||||
|
|
|
@ -74,15 +74,14 @@ void start_timer ( struct retry_timer *timer ) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Start timer with no delay
|
||||
* Start timer with a specified fixed timeout
|
||||
*
|
||||
* @v timer Retry timer
|
||||
*
|
||||
* This starts the timer running with a zero timeout value.
|
||||
* @v timeout Timeout, in ticks
|
||||
*/
|
||||
void start_timer_nodelay ( struct retry_timer *timer ) {
|
||||
void start_timer_fixed ( struct retry_timer *timer, unsigned long timeout ) {
|
||||
start_timer ( timer );
|
||||
timer->timeout = 0;
|
||||
timer->timeout = timeout;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue