Lines Matching refs:t
61 list_add( Timer* t ) in list_add() argument
68 timers = t; in list_add()
69 t->prev = t->next = NULL; in list_add()
71 if (iperf_time_compare(&t->time, &timers->time) < 0) { in list_add()
73 t->prev = NULL; in list_add()
74 t->next = timers; in list_add()
75 timers->prev = t; in list_add()
76 timers = t; in list_add()
81 if (iperf_time_compare(&t->time, &t2->time) < 0) { in list_add()
83 t2prev->next = t; in list_add()
84 t->prev = t2prev; in list_add()
85 t->next = t2; in list_add()
86 t2->prev = t; in list_add()
91 t2prev->next = t; in list_add()
92 t->prev = t2prev; in list_add()
93 t->next = NULL; in list_add()
100 list_remove( Timer* t ) in list_remove() argument
102 if ( t->prev == NULL ) in list_remove()
103 timers = t->next; in list_remove()
105 t->prev->next = t->next; in list_remove()
106 if ( t->next != NULL ) in list_remove()
107 t->next->prev = t->prev; in list_remove()
112 list_resort( Timer* t ) in list_resort() argument
115 list_remove( t ); in list_resort()
117 list_add( t ); in list_resort()
127 Timer* t; in tmr_create() local
132 t = free_timers; in tmr_create()
133 free_timers = t->next; in tmr_create()
135 t = (Timer*) malloc( sizeof(Timer) ); in tmr_create()
136 if ( t == NULL ) in tmr_create()
140 t->timer_proc = timer_proc; in tmr_create()
141 t->client_data = client_data; in tmr_create()
142 t->usecs = usecs; in tmr_create()
143 t->periodic = periodic; in tmr_create()
144 t->time = now; in tmr_create()
145 iperf_time_add_usecs(&t->time, usecs); in tmr_create()
147 list_add( t ); in tmr_create()
149 return t; in tmr_create()
180 Timer* t; in tmr_run() local
184 for ( t = timers; t != NULL; t = next ) { in tmr_run()
185 next = t->next; in tmr_run()
189 if (iperf_time_compare(&t->time, &now) > 0) in tmr_run()
191 (t->timer_proc)( t->client_data, &now ); in tmr_run()
192 if ( t->periodic ) { in tmr_run()
194 iperf_time_add_usecs(&t->time, t->usecs); in tmr_run()
195 list_resort( t ); in tmr_run()
197 tmr_cancel( t ); in tmr_run()
203 tmr_reset( struct iperf_time* nowP, Timer* t ) in tmr_reset() argument
208 t->time = now; in tmr_reset()
209 iperf_time_add_usecs( &t->time, t->usecs ); in tmr_reset()
210 list_resort( t ); in tmr_reset()
215 tmr_cancel( Timer* t ) in tmr_cancel() argument
218 list_remove( t ); in tmr_cancel()
220 t->next = free_timers; in tmr_cancel()
221 free_timers = t; in tmr_cancel()
222 t->prev = NULL; in tmr_cancel()
229 Timer* t; in tmr_cleanup() local
232 t = free_timers; in tmr_cleanup()
233 free_timers = t->next; in tmr_cleanup()
234 free( (void*) t ); in tmr_cleanup()