diff options
author | Michael Brown <mcb30@etherboot.org> | 2007-05-26 15:00:56 +0000 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2007-05-26 15:00:56 +0000 |
commit | 360110338147844bfa4612ae2d6351f1d1054626 (patch) | |
tree | 2bee0111a128e36f3f958f0a19c311ec1cc1b912 /src/net/retry.c | |
parent | 6006bed530b41e51e9ceccb04849a290496c6bfd (diff) | |
download | ipxe-360110338147844bfa4612ae2d6351f1d1054626.zip ipxe-360110338147844bfa4612ae2d6351f1d1054626.tar.gz ipxe-360110338147844bfa4612ae2d6351f1d1054626.tar.bz2 |
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 cd683f5..f8c34b8 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 ); |