MT#55283 refactor call_timer

Use the looper thread helper functions.

Change-Id: I847444d894cb3bfd763897566bd7dc6c66dc8817
pull/1676/head
Richard Fuchs 3 years ago
parent 2e4dec10ea
commit c34f3e6765

@ -495,7 +495,7 @@ destroy:
free(url_suffix);
}
void call_timer(void *ptr) {
enum thread_looper_action call_timer() {
struct iterator_helper hlp;
ZERO(hlp);
@ -511,6 +511,8 @@ void call_timer(void *ptr) {
/* add thread scope (local) sockets to the global list, in order to release them later */
append_thread_lpr_to_glob_lpr();
return TLA_CONTINUE;
}
#undef DS
@ -524,7 +526,8 @@ int call_init() {
for (int i = 0; i < NUM_CALL_ITERATORS; i++)
mutex_init(&rtpe_call_iterators[i].lock);
poller_add_timer(rtpe_poller, call_timer, NULL);
thread_create_looper(call_timer, rtpe_config.idle_scheduling,
rtpe_config.idle_priority, "kill calls timer", 1000000);
if (mqtt_publish_scope() != MPS_NONE)
mqtt_timer_start(&global_mqtt_timer, NULL, NULL);

@ -754,7 +754,7 @@ int call_stream_address46(char *o, struct packet_stream *ps, enum stream_address
int *len, const struct local_intf *ifa, bool keep_unspec);
void add_total_calls_duration_in_interval(struct timeval *interval_tv);
void call_timer(void *ptr);
enum thread_looper_action call_timer(void);
void __rtp_stats_update(GHashTable *dst, struct codec_store *);
int __init_stream(struct packet_stream *ps);

@ -3230,7 +3230,7 @@ int main(void) {
// test cmd_ps_min/max/avg
call_timer(NULL);
call_timer();
stats_counters_calc_rate(&rtpe_stats, 150000000, &rtpe_stats_intv, &rtpe_stats_rate);
stats_rate_min_max(&rtpe_rate_graphite_min_max, &rtpe_stats_rate);
ice_slow_timer();
@ -3239,7 +3239,7 @@ int main(void) {
rtpe_now.tv_sec += 2;
RTPE_STATS_ADD(ng_commands[NGC_OFFER], 20);
call_timer(NULL);
call_timer();
stats_counters_calc_rate(&rtpe_stats, 2000000, &rtpe_stats_intv, &rtpe_stats_rate);
stats_rate_min_max(&rtpe_rate_graphite_min_max, &rtpe_stats_rate);
ice_slow_timer();
@ -3248,7 +3248,7 @@ int main(void) {
rtpe_now.tv_sec += 5;
RTPE_STATS_ADD(ng_commands[NGC_OFFER], 200);
call_timer(NULL);
call_timer();
stats_counters_calc_rate(&rtpe_stats, 5000000, &rtpe_stats_intv, &rtpe_stats_rate);
stats_rate_min_max(&rtpe_rate_graphite_min_max, &rtpe_stats_rate);
ice_slow_timer();

Loading…
Cancel
Save