diff options
author | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-02-10 17:51:34 +0000 |
---|---|---|
committer | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-02-10 17:51:34 +0000 |
commit | 5601d4bbb5ea73ce5ecb9fd7425ca99834b85232 (patch) | |
tree | 37f55680795dc66798867a008ae7b119c8b68eae /apps | |
parent | ddc88b606d678cb8190dbf806efd7a4ad89620a2 (diff) |
Merged revisions 246116 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r246116 | dvossel | 2010-02-10 11:49:34 -0600 (Wed, 10 Feb 2010) | 14 lines
Merged revisions 246115 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r246115 | dvossel | 2010-02-10 11:44:20 -0600 (Wed, 10 Feb 2010) | 8 lines
fixes random deadlock in app_queue with use_weight during reload
(closes issue #16677)
Reported by: tim_ringenbach
Patches:
app_queue_use_weight_deadlock.diff uploaded by tim ringenbach (license 540)
........
................
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@246117 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_queue.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index d16edeadc..eeb0c8c5c 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -3605,6 +3605,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce struct ao2_iterator memi; struct ast_datastore *datastore, *transfer_ds; struct queue_end_bridge *queue_end_bridge = NULL; + const int need_weight = use_weight; ast_channel_lock(qe->chan); datastore = ast_channel_datastore_find(qe->chan, &dialed_interface_info, NULL); @@ -3686,7 +3687,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce } /* Hold the lock while we setup the outgoing calls */ - if (use_weight) + if (need_weight) ao2_lock(queues); ao2_lock(qe->parent); ast_debug(1, "%s is trying to call a queue member.\n", @@ -3706,7 +3707,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce ao2_ref(cur, -1); ao2_unlock(qe->parent); ao2_iterator_destroy(&memi); - if (use_weight) + if (need_weight) ao2_unlock(queues); goto out; } @@ -3715,7 +3716,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce ao2_ref(cur, -1); ao2_unlock(qe->parent); ao2_iterator_destroy(&memi); - if (use_weight) + if (need_weight) ao2_unlock(queues); free(tmp); goto out; @@ -3725,7 +3726,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce ao2_ref(cur, -1); ao2_unlock(&qe->parent); ao2_iterator_destroy(&memi); - if (use_weight) + if (need_weight) ao2_unlock(queues); free(tmp); goto out; @@ -3763,7 +3764,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce ao2_ref(cur, -1); ao2_unlock(qe->parent); ao2_iterator_destroy(&memi); - if (use_weight) + if (need_weight) ao2_unlock(queues); free(tmp); goto out; @@ -3819,7 +3820,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce ++qe->pending; ao2_unlock(qe->parent); ring_one(qe, outgoing, &numbusies); - if (use_weight) + if (need_weight) ao2_unlock(queues); lpeer = wait_for_answer(qe, outgoing, &to, &digit, numbusies, ast_test_flag(&(bridge_config.features_caller), AST_FEATURE_DISCONNECT), forwardsallowed); /* The ast_channel_datastore_remove() function could fail here if the |