diff options
author | Michael Brown | 2007-05-26 17:00:56 +0200 |
---|---|---|
committer | Michael Brown | 2007-05-26 17:00:56 +0200 |
commit | 360110338147844bfa4612ae2d6351f1d1054626 (patch) | |
tree | 2bee0111a128e36f3f958f0a19c311ec1cc1b912 /src/net/retry.c | |
parent | Free I/O buffers when we are finished with them! (diff) | |
download | ipxe-360110338147844bfa4612ae2d6351f1d1054626.tar.gz ipxe-360110338147844bfa4612ae2d6351f1d1054626.tar.xz ipxe-360110338147844bfa4612ae2d6351f1d1054626.zip |
Modify process semantics; rescheduling is now automatic.
Add reference-counting to processes.
Add timer_running() test.
Diffstat (limited to 'src/net/retry.c')
-rw-r--r-- | src/net/retry.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/net/retry.c b/src/net/retry.c index cd683f5b..f8c34b81 100644 --- a/src/net/retry.c +++ b/src/net/retry.c @@ -64,7 +64,7 @@ static LIST_HEAD ( timers ); * be stopped and the timer's callback function will be called. */ void start_timer ( struct retry_timer *timer ) { - if ( ! timer->start ) + if ( ! timer_running ( timer ) ) list_add ( &timer->list, &timers ); timer->start = currticks(); if ( timer->timeout < MIN_TIMEOUT ) @@ -86,7 +86,7 @@ void stop_timer ( struct retry_timer *timer ) { unsigned long runtime; /* If timer was already stopped, do nothing */ - if ( ! timer->start ) + if ( ! timer_running ( timer ) ) return; list_del ( &timer->list ); @@ -153,7 +153,7 @@ static void timer_expired ( struct retry_timer *timer ) { * * @v process Retry timer process */ -static void retry_step ( struct process *process ) { +static void retry_step ( struct process *process __unused ) { struct retry_timer *timer; struct retry_timer *tmp; unsigned long now = currticks(); @@ -164,8 +164,6 @@ static void retry_step ( struct process *process ) { if ( used >= timer->timeout ) timer_expired ( timer ); } - - schedule ( process ); } /** Retry timer process */ @@ -175,7 +173,7 @@ static struct process retry_process = { /** Initialise the retry timer module */ static void init_retry ( void ) { - schedule ( &retry_process ); + process_add ( &retry_process ); } INIT_FN ( INIT_PROCESS, init_retry, NULL, NULL ); |