1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Support multiple threads by thread pool. v5.0.32

This commit is contained in:
winlin 2022-06-29 20:15:44 +08:00
parent 7c6bd0ce5c
commit b2e083b00d
12 changed files with 479 additions and 104 deletions

View file

@ -2389,7 +2389,7 @@ srs_error_t SrsConfig::check_normal_config()
&& n != "ff_log_level" && n != "grace_final_wait" && n != "force_grace_quit"
&& n != "grace_start_wait" && n != "empty_ip_ok" && n != "disable_daemon_for_docker"
&& n != "inotify_auto_reload" && n != "auto_reload_for_docker" && n != "tcmalloc_release_rate"
&& n != "query_latest_version"
&& n != "query_latest_version" && n != "threads"
&& n != "circuit_breaker" && n != "is_full" && n != "in_docker"
) {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal directive %s", n.c_str());
@ -3155,6 +3155,28 @@ double SrsConfig::tcmalloc_release_rate()
return trr;
}
srs_utime_t SrsConfig::get_threads_interval()
{
static srs_utime_t DEFAULT = 5 * SRS_UTIME_SECONDS;
SrsConfDirective* conf = root->get("threads");
if (!conf) {
return DEFAULT;
}
conf = conf->get("interval");
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}
int v = ::atoi(conf->arg0().c_str());
if (v <= 0) {
return DEFAULT;
}
return v * SRS_UTIME_SECONDS;
}
bool SrsConfig::get_circuit_breaker()
{
static bool DEFAULT = true;