summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAutomerge script <automerge@asterisk.org>2012-12-17 21:18:01 +0000
committerAutomerge script <automerge@asterisk.org>2012-12-17 21:18:01 +0000
commitbe4cc7b20bba0a34e2e179a91456f22ea24b9eca (patch)
tree96ff890d06fc83d4d3b8c54d63cbe2cd21d167a5
parentd4aeeecffa1b93c32159184171c28751f546f28a (diff)
Merged revisions 378072,378074 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk ................ r378072 | rmudgett | 2012-12-17 14:34:25 -0600 (Mon, 17 Dec 2012) | 9 lines chan_local: Misc lock and ref tweaks. * awesome_locking() does not need to thrash the pvt lock as much. * local_setoption() does not need to check for NULL pvt on cleanup since it will never be NULL. * Made ref the pvt before locking for consistency. ................ r378074 | qwell | 2012-12-17 14:59:51 -0600 (Mon, 17 Dec 2012) | 10 lines Make libasteriskssl.so symlink use a relative path. This was causing issues when using DESTDIR, since the path to which the link pointed is not likely to exist (and not useful to exist) on the target system. (issue ASTNOW-284) ........ Merged revisions 378073 from http://svn.asterisk.org/svn/asterisk/branches/11 ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@378076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--channels/chan_local.c20
-rw-r--r--main/Makefile2
2 files changed, 9 insertions, 13 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c
index da86e1473..f51a0405b 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -161,7 +161,7 @@ struct local_pvt {
#define LOCAL_BRIDGE (1 << 3) /*!< Report back the "true" channel as being bridged to */
#define LOCAL_MOH_PASSTHRU (1 << 4) /*!< Pass through music on hold start/stop frames */
-/*
+/*!
* \brief Send a pvt in with no locks held and get all locks
*
* \note NO locks should be held prior to calling this function
@@ -175,8 +175,8 @@ static void awesome_locking(struct local_pvt *p, struct ast_channel **outchan, s
struct ast_channel *chan = NULL;
struct ast_channel *owner = NULL;
+ ao2_lock(p);
for (;;) {
- ao2_lock(p);
if (p->chan) {
chan = p->chan;
ast_channel_ref(chan);
@@ -194,12 +194,11 @@ static void awesome_locking(struct local_pvt *p, struct ast_channel **outchan, s
} else if(chan) {
ast_channel_lock(chan);
}
- ao2_lock(p);
} else {
/* lock both channels first, then get the pvt lock */
ast_channel_lock_both(chan, owner);
- ao2_lock(p);
}
+ ao2_lock(p);
/* Now that we have all the locks, validate that nothing changed */
if (p->owner != owner || p->chan != chan) {
@@ -211,7 +210,6 @@ static void awesome_locking(struct local_pvt *p, struct ast_channel **outchan, s
ast_channel_unlock(chan);
chan = ast_channel_unref(chan);
}
- ao2_unlock(p);
continue;
}
@@ -225,7 +223,7 @@ static void awesome_locking(struct local_pvt *p, struct ast_channel **outchan, s
static int local_setoption(struct ast_channel *ast, int option, void * data, int datalen)
{
int res = 0;
- struct local_pvt *p = NULL;
+ struct local_pvt *p;
struct ast_channel *otherchan = NULL;
ast_chan_write_info_t *write_info;
@@ -272,9 +270,7 @@ static int local_setoption(struct ast_channel *ast, int option, void * data, int
ast_channel_unlock(otherchan);
setoption_cleanup:
- if (p) {
- ao2_ref(p, -1);
- }
+ ao2_ref(p, -1);
if (otherchan) {
ast_channel_unref(otherchan);
}
@@ -468,8 +464,8 @@ static int local_answer(struct ast_channel *ast)
return -1;
}
- ao2_lock(p);
ao2_ref(p, 1);
+ ao2_lock(p);
isoutbound = IS_OUTBOUND(ast, p);
if (isoutbound) {
/* Pass along answer since somebody answered us */
@@ -839,8 +835,8 @@ static int local_sendtext(struct ast_channel *ast, const char *text)
return -1;
}
- ao2_lock(p);
ao2_ref(p, 1); /* ref for local_queue_frame */
+ ao2_lock(p);
isoutbound = IS_OUTBOUND(ast, p);
f.data.ptr = (char *) text;
f.datalen = strlen(text) + 1;
@@ -861,8 +857,8 @@ static int local_sendhtml(struct ast_channel *ast, int subclass, const char *dat
return -1;
}
- ao2_lock(p);
ao2_ref(p, 1); /* ref for local_queue_frame */
+ ao2_lock(p);
isoutbound = IS_OUTBOUND(ast, p);
f.subclass.integer = subclass;
f.data.ptr = (char *)data;
diff --git a/main/Makefile b/main/Makefile
index 2adc500fd..d0a2d0559 100644
--- a/main/Makefile
+++ b/main/Makefile
@@ -259,7 +259,7 @@ bininstall:
ifeq ($(AST_ASTERISKSSL),yes)
ifeq ($(findstring darwin,$(OSARCH)),) # not Darwin
$(INSTALL) -m 755 $(ASTSSL_LIB).$(ASTSSL_SO_VERSION) "$(DESTDIR)$(ASTLIBDIR)/"
- $(LN) -sf "$(DESTDIR)$(ASTLIBDIR)/$(ASTSSL_LIB).$(ASTSSL_SO_VERSION)" "$(DESTDIR)$(ASTLIBDIR)/$(ASTSSL_LIB)"
+ $(LN) -sf $(ASTSSL_LIB).$(ASTSSL_SO_VERSION) "$(DESTDIR)$(ASTLIBDIR)/$(ASTSSL_LIB)"
else # Darwin
$(INSTALL) -m 755 $(ASTSSL_LIB) "$(DESTDIR)$(ASTLIBDIR)/"
endif