summaryrefslogtreecommitdiff
path: root/channels/chan_skinny.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-06-22 17:42:14 +0000
committerMark Spencer <markster@digium.com>2004-06-22 17:42:14 +0000
commit5546e323550422b8a84e7c1d0b69e11623666cb6 (patch)
treea3a0875ae4e73c9d9a1fc67f56ffa1ce73fe5457 /channels/chan_skinny.c
parent2f4a0dc3f5743f625976e39c031adbc7002f57d0 (diff)
Merge major BSD mutex and symbol conflict patches (bug #1816) (link patch still pending)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3273 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_skinny.c')
-rwxr-xr-xchannels/chan_skinny.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index e5189634e..d73ce62b8 100755
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -1104,6 +1104,7 @@ static struct skinny_device *build_device(char *cat, struct ast_variable *v)
l = malloc(sizeof(struct skinny_line));;
if (l) {
memset(l, 0, sizeof(struct skinny_line));
+ ast_mutex_init(&l->lock);
strncpy(l->name, v->value, sizeof(l->name) - 1);
/* XXX Should we check for uniqueness?? XXX */
@@ -1145,6 +1146,7 @@ static struct skinny_device *build_device(char *cat, struct ast_variable *v)
if (sub) {
ast_verbose(VERBOSE_PREFIX_3 "Allocating Skinny subchannel '%d' on %s@%s\n", i, l->name, d->name);
memset(sub, 0, sizeof(struct skinny_subchannel));
+ ast_mutex_init(&sub->lock);
sub->parent = l;
/* Make a call*ID */
sub->callid = callnums;
@@ -2262,6 +2264,7 @@ static void destroy_session(struct skinnysession *s)
sessions = cur->next;
if (s->fd > -1)
close(s->fd);
+ ast_mutex_destroy(&s->lock);
free(s);
} else
ast_log(LOG_WARNING, "Trying to delete non-existant session %p?\n", s);
@@ -2662,10 +2665,12 @@ void delete_devices(void)
for (sub=l->sub;sub;) {
slast = sub;
sub = sub->next;
+ ast_mutex_destroy(&slast->lock);
free(slast);
}
llast = l;
l = l->next;
+ ast_mutex_destroy(&llast->lock);
free(llast);
}
dlast = d;
@@ -2758,6 +2763,7 @@ int unload_module()
pl = p;
p = p->next;
/* Free associated memory */
+ ast_mutex_destroy(&pl->lock);
free(pl);
}
iflist = NULL;