瀏覽代碼

- tm cleanups ported form stable

Andrei Pelinescu-Onciul 22 年之前
父節點
當前提交
cd518c60d0
共有 2 個文件被更改,包括 13 次插入7 次删除
  1. 10 5
      modules/tm/timer.c
  2. 3 2
      modules/tm/timer.h

+ 10 - 5
modules/tm/timer.c

@@ -156,6 +156,7 @@ unsigned int timer_id2timeout[NR_OF_TIMER_LISTS] = {
 /******************** handlers ***************************/
 
 
+static void unlink_timers( struct cell *t );
 
 static void delete_cell( struct cell *p_cell, int unlock )
 {
@@ -270,6 +271,8 @@ static void fake_reply(struct cell *t, int branch, int code )
 }
 
 
+
+
 inline static void retransmission_handler( void *attr)
 {
 	struct retr_buf* r_buf ;
@@ -578,8 +581,7 @@ void print_timer_list( enum lists list_id)
 
 
 
-
-void remove_timer_unsafe(  struct timer_link* tl )
+static void remove_timer_unsafe(  struct timer_link* tl )
 {
 #ifdef EXTRA_DEBUG
 	if (tl && tl->timer_list &&
@@ -606,7 +608,7 @@ void remove_timer_unsafe(  struct timer_link* tl )
 
 
 /* put a new cell into a list nr. list_id */
-void add_timer_unsafe( struct timer *timer_list, struct timer_link *tl,
+static void add_timer_unsafe( struct timer *timer_list, struct timer_link *tl,
 	unsigned int time_out )
 {
 #ifdef EXTRA_DEBUG
@@ -636,7 +638,7 @@ void add_timer_unsafe( struct timer *timer_list, struct timer_link *tl,
 
 
 /* detach items passed by the time from timer list */
-struct timer_link  *check_and_split_time_list( struct timer *timer_list,
+static struct timer_link  *check_and_split_time_list( struct timer *timer_list,
 	int time )
 {
 	struct timer_link *tl , *end, *ret;
@@ -782,7 +784,10 @@ void set_1timer( struct timer_link *new_tl, enum lists list_id )
 }
 
 
-void unlink_timers( struct cell *t )
+
+/* should be called only from timer process context,
+ * else it's unsafe */
+static void unlink_timers( struct cell *t )
 {
 	int i;
 	int remove_fr, remove_retr;

+ 3 - 2
modules/tm/timer.h

@@ -103,9 +103,10 @@ void unlink_timer_lists();
 void free_timer_table();
 void init_timer_list( enum lists list_id);
 void reset_timer_list( enum lists list_id);
-void remove_timer_unsafe(  struct timer_link* tl ) ;
+/*void remove_timer_unsafe(  struct timer_link* tl ) ;
 void add_timer_unsafe( struct timer*, struct timer_link*, unsigned int);
 struct timer_link  *check_and_split_time_list( struct timer*, int);
+*/
 
 void reset_timer( struct timer_link* tl );
 /* determine timer length and put on a correct timer list */
@@ -113,7 +114,7 @@ void set_timer( struct timer_link *new_tl, enum lists list_id );
 /* similar to set_timer, except it allows only one-time
    timer setting and all later attempts are ignored */
 void set_1timer( struct timer_link *new_tl, enum lists list_id );
-void unlink_timers( struct cell *t );
+/*void unlink_timers( struct cell *t );*/
 void timer_routine(unsigned int, void*);