diff options
author | Joshua Colp <jcolp@digium.com> | 2016-06-09 20:25:09 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2016-06-09 20:25:09 -0500 |
commit | e842a99e7cbf0bbb4a4147329c88a4ec1b2ebee4 (patch) | |
tree | 6ae27641c0fd21c1015c15fda1769c8dcbaaa5c9 /main | |
parent | 1ac47c5aae82da390fd46b0ce06d10688bcee23d (diff) | |
parent | 110d7724675a496dd1c338e296e0c26d96156c3e (diff) |
Merge "sorcery: Add setting object type congestion levels." into 13
Diffstat (limited to 'main')
-rw-r--r-- | main/sorcery.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/main/sorcery.c b/main/sorcery.c index 3a29cfa58..4dedc4d9b 100644 --- a/main/sorcery.c +++ b/main/sorcery.c @@ -1161,6 +1161,20 @@ int __ast_sorcery_object_register(struct ast_sorcery *sorcery, const char *type, return 0; } +int ast_sorcery_object_set_congestion_levels(struct ast_sorcery *sorcery, const char *type, long low_water, long high_water) +{ + struct ast_sorcery_object_type *object_type; + int res = -1; + + object_type = ao2_find(sorcery->types, type, OBJ_SEARCH_KEY); + if (object_type) { + res = ast_taskprocessor_alert_set_levels(object_type->serializer, + low_water, high_water); + ao2_ref(object_type, -1); + } + return res; +} + void ast_sorcery_object_set_copy_handler(struct ast_sorcery *sorcery, const char *type, sorcery_copy_handler copy) { RAII_VAR(struct ast_sorcery_object_type *, object_type, ao2_find(sorcery->types, type, OBJ_KEY), ao2_cleanup); |