MT#56374 delay thread creation until after forking

Forking to background kills already created threads, so forking must
happen first and thread creation after.

closes #1695

Change-Id: I743b890b83903d9e0b3248b032844e7e357d2307
pull/1701/head
Richard Fuchs 2 years ago
parent d9e682b7db
commit e82c4ada1a

@ -526,9 +526,6 @@ int call_init() {
for (int i = 0; i < NUM_CALL_ITERATORS; i++)
mutex_init(&rtpe_call_iterators[i].lock);
thread_create_looper(call_timer, rtpe_config.idle_scheduling,
rtpe_config.idle_priority, "kill calls", 1000000);
if (mqtt_publish_scope() != MPS_NONE)
mqtt_timer_start(&global_mqtt_timer, NULL, NULL);

@ -1113,8 +1113,6 @@ no_kernel:
if (!rtpe_poller_map)
die("poller map creation failed");
dtls_timer();
if (call_init())
abort();
@ -1335,6 +1333,13 @@ int main(int argc, char **argv) {
thread_create_looper(ice_slow_timer, rtpe_config.idle_scheduling,
rtpe_config.idle_priority, "ICE slow", 1000000);
/* thread to close expired call */
thread_create_looper(call_timer, rtpe_config.idle_scheduling,
rtpe_config.idle_priority, "kill calls", 1000000);
/* thread to refresh DTLS certificate */
dtls_timer();
if (!is_addr_unspecified(&rtpe_config.redis_ep.address) && initial_rtpe_config.redis_delete_async)
thread_create_detach(redis_delete_async_loop, NULL, "redis async");

Loading…
Cancel
Save