diff options
author | pabelanger <pabelanger@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-06-02 13:34:09 +0000 |
---|---|---|
committer | pabelanger <pabelanger@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-06-02 13:34:09 +0000 |
commit | 469c770d909ee00d546af6260e500068a8b8d71e (patch) | |
tree | 17ce70b33fe57e3ce6f8259d95ff67b29fd15882 /main/bridging.c | |
parent | b762dfbef1ddaf6a74e4b913fbdab39276858bc5 (diff) |
Merged revisions 266877 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r266877 | pabelanger | 2010-06-02 09:32:22 -0400 (Wed, 02 Jun 2010) | 10 lines
pthread_join to assure the thread is really gone
(closes issue #15465)
Reported by: fnordian
Patches:
bridging.patch uploaded by fnordian (license 110)
Tested by: lmadsen, fnordian, peterh
Review: https://reviewboard.asterisk.org/r/679/
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@266878 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/bridging.c')
-rw-r--r-- | main/bridging.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/main/bridging.c b/main/bridging.c index 2f5afa2cb..e03454334 100644 --- a/main/bridging.c +++ b/main/bridging.c @@ -626,11 +626,16 @@ static int smart_bridge_operation(struct ast_bridge *bridge, struct ast_bridge_c if (new_technology->capabilities & AST_BRIDGE_CAPABILITY_THREAD) { ast_debug(1, "Telling current bridge thread for bridge %p to refresh\n", bridge); bridge->refresh = 1; + bridge_poke(bridge); } else { + pthread_t bridge_thread = bridge->thread; ast_debug(1, "Telling current bridge thread for bridge %p to stop\n", bridge); bridge->stop = 1; + bridge_poke(bridge); + ao2_unlock(bridge); + pthread_join(bridge_thread, NULL); + ao2_lock(bridge); } - bridge_poke(bridge); } /* Since we are soon going to pass this bridge to a new technology we need to NULL out the bridge_pvt pointer but don't worry as it still exists in temp_bridge, ditto for the old technology */ |