diff options
Diffstat (limited to 'zebra/zebra_fpm.c')
| -rw-r--r-- | zebra/zebra_fpm.c | 51 |
1 files changed, 23 insertions, 28 deletions
diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c index 405b2e9f79..2a23ff1027 100644 --- a/zebra/zebra_fpm.c +++ b/zebra/zebra_fpm.c @@ -16,10 +16,9 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with GNU Zebra; see the file COPYING. If not, write to the Free - * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. + * You should have received a copy of the GNU General Public License along + * with this program; see the file COPYING; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include <zebra.h> @@ -487,8 +486,8 @@ zfpm_read_on (void) assert (!zfpm_g->t_read); assert (zfpm_g->sock >= 0); - THREAD_READ_ON (zfpm_g->master, zfpm_g->t_read, zfpm_read_cb, 0, - zfpm_g->sock); + thread_add_read(zfpm_g->master, zfpm_read_cb, 0, zfpm_g->sock, + &zfpm_g->t_read); } /* @@ -500,8 +499,8 @@ zfpm_write_on (void) assert (!zfpm_g->t_write); assert (zfpm_g->sock >= 0); - THREAD_WRITE_ON (zfpm_g->master, zfpm_g->t_write, zfpm_write_cb, 0, - zfpm_g->sock); + thread_add_write(zfpm_g->master, zfpm_write_cb, 0, zfpm_g->sock, + &zfpm_g->t_write); } /* @@ -535,7 +534,6 @@ zfpm_conn_up_thread_cb (struct thread *thread) zfpm_rnodes_iter_t *iter; rib_dest_t *dest; - assert (zfpm_g->t_conn_up); zfpm_g->t_conn_up = NULL; iter = &zfpm_g->t_conn_up_state.iter; @@ -565,9 +563,9 @@ zfpm_conn_up_thread_cb (struct thread *thread) zfpm_g->stats.t_conn_up_yields++; zfpm_rnodes_iter_pause (iter); - zfpm_g->t_conn_up = thread_add_background (zfpm_g->master, - zfpm_conn_up_thread_cb, - 0, 0); + zfpm_g->t_conn_up = NULL; + thread_add_background(zfpm_g->master, zfpm_conn_up_thread_cb, 0, 0, + &zfpm_g->t_conn_up); return 0; } @@ -599,8 +597,9 @@ zfpm_connection_up (const char *detail) zfpm_rnodes_iter_init (&zfpm_g->t_conn_up_state.iter); zfpm_debug ("Starting conn_up thread"); - zfpm_g->t_conn_up = thread_add_background (zfpm_g->master, - zfpm_conn_up_thread_cb, 0, 0); + zfpm_g->t_conn_up = NULL; + thread_add_background(zfpm_g->master, zfpm_conn_up_thread_cb, 0, 0, + &zfpm_g->t_conn_up); zfpm_g->stats.t_conn_up_starts++; } @@ -654,7 +653,6 @@ zfpm_conn_down_thread_cb (struct thread *thread) assert (zfpm_g->state == ZFPM_STATE_IDLE); - assert (zfpm_g->t_conn_down); zfpm_g->t_conn_down = NULL; iter = &zfpm_g->t_conn_down_state.iter; @@ -689,9 +687,9 @@ zfpm_conn_down_thread_cb (struct thread *thread) zfpm_g->stats.t_conn_down_yields++; zfpm_rnodes_iter_pause (iter); - zfpm_g->t_conn_down = thread_add_background (zfpm_g->master, - zfpm_conn_down_thread_cb, - 0, 0); + zfpm_g->t_conn_down = NULL; + thread_add_background(zfpm_g->master, zfpm_conn_down_thread_cb, 0, 0, + &zfpm_g->t_conn_down); return 0; } @@ -737,8 +735,9 @@ zfpm_connection_down (const char *detail) assert (!zfpm_g->t_conn_down); zfpm_debug ("Starting conn_down thread"); zfpm_rnodes_iter_init (&zfpm_g->t_conn_down_state.iter); - zfpm_g->t_conn_down = thread_add_background (zfpm_g->master, - zfpm_conn_down_thread_cb, 0, 0); + zfpm_g->t_conn_down = NULL; + thread_add_background(zfpm_g->master, zfpm_conn_down_thread_cb, 0, 0, + &zfpm_g->t_conn_down); zfpm_g->stats.t_conn_down_starts++; zfpm_set_state (ZFPM_STATE_IDLE, detail); @@ -756,7 +755,6 @@ zfpm_read_cb (struct thread *thread) fpm_msg_hdr_t *hdr; zfpm_g->stats.read_cb_calls++; - assert (zfpm_g->t_read); zfpm_g->t_read = NULL; /* @@ -1045,7 +1043,6 @@ zfpm_write_cb (struct thread *thread) int num_writes; zfpm_g->stats.write_cb_calls++; - assert (zfpm_g->t_write); zfpm_g->t_write = NULL; /* @@ -1137,7 +1134,6 @@ zfpm_connect_cb (struct thread *t) int sock, ret; struct sockaddr_in serv; - assert (zfpm_g->t_connect); zfpm_g->t_connect = NULL; assert (zfpm_g->state == ZFPM_STATE_ACTIVE); @@ -1294,8 +1290,8 @@ zfpm_start_connect_timer (const char *reason) delay_secs = zfpm_calc_connect_delay(); zfpm_debug ("scheduling connect in %ld seconds", delay_secs); - THREAD_TIMER_ON (zfpm_g->master, zfpm_g->t_connect, zfpm_connect_cb, 0, - delay_secs); + thread_add_timer(zfpm_g->master, zfpm_connect_cb, 0, delay_secs, + &zfpm_g->t_connect); zfpm_set_state (ZFPM_STATE_ACTIVE, reason); } @@ -1388,7 +1384,6 @@ zfpm_trigger_update (struct route_node *rn, const char *reason) static int zfpm_stats_timer_cb (struct thread *t) { - assert (zfpm_g->t_stats); zfpm_g->t_stats = NULL; /* @@ -1434,8 +1429,8 @@ zfpm_start_stats_timer (void) { assert (!zfpm_g->t_stats); - THREAD_TIMER_ON (zfpm_g->master, zfpm_g->t_stats, zfpm_stats_timer_cb, 0, - ZFPM_STATS_IVL_SECS); + thread_add_timer(zfpm_g->master, zfpm_stats_timer_cb, 0, + ZFPM_STATS_IVL_SECS, &zfpm_g->t_stats); } /* |
