Further fixes to improper usage of scheduler

When ASTERISK-25449 was closed, a number of scheduler issues mentioned in
the comments were missed. These have since beed raised in ASTERISK-25476
and elsewhere.

This patch attempts to collect all of the scheduler issues discovered so
far and address them sensibly.

ASTERISK-25476 #close

Change-Id: I87a77d581e2e0d91d33b4b2fbff80f64a566d05b
This commit is contained in:
Steve Davies
2015-11-11 10:16:22 +00:00
parent dac0bf063c
commit 07583c2888
3 changed files with 17 additions and 11 deletions

View File

@@ -7114,7 +7114,7 @@ static char *handle_cli_iax2_unregister(struct ast_cli_entry *e, int cmd, struct
p = find_peer(a->argv[2], 1);
if (p) {
if (p->expire > 0) {
if (p->expire > -1) {
struct iax2_peer *peer;
peer = ao2_find(peers, a->argv[2], OBJ_KEY);
@@ -7146,8 +7146,8 @@ static char *complete_iax2_unregister(const char *line, const char *word, int po
if (pos == 2) {
struct ao2_iterator i = ao2_iterator_init(peers, 0);
while ((p = ao2_iterator_next(&i))) {
if (!strncasecmp(p->name, word, wordlen) &&
++which > state && p->expire > 0) {
if (!strncasecmp(p->name, word, wordlen) &&
++which > state && p->expire > -1) {
res = ast_strdup(p->name);
peer_unref(p);
break;