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
This commit is contained in:
Mark Spencer
2004-06-22 17:42:14 +00:00
parent 2f4a0dc3f5
commit 5546e32355
30 changed files with 432 additions and 164 deletions

View File

@@ -87,6 +87,7 @@ retrylock:
/* We had a glare on the hangup. Forget all this business,
return and destroy p. */
ast_mutex_unlock(&p->lock);
ast_mutex_destroy(&p->lock);
free(p);
return -1;
}
@@ -271,6 +272,7 @@ static void local_destroy(struct local_pvt *p)
prev->next = cur->next;
else
locals = cur->next;
ast_mutex_destroy(cur);
free(cur);
break;
}
@@ -324,8 +326,10 @@ static int local_hangup(struct ast_channel *ast)
}
ast_mutex_unlock(&locallock);
/* And destroy */
if (!glaredetect)
if (!glaredetect) {
ast_mutex_destroy(&p->lock);
free(p);
}
return 0;
}
if (p->chan && !p->launchedpbx)
@@ -366,6 +370,7 @@ static struct local_pvt *local_alloc(char *data, int format)
tmp->reqformat = format;
if (!ast_exists_extension(NULL, tmp->context, tmp->exten, 1, NULL)) {
ast_log(LOG_NOTICE, "No such extension/context %s@%s creating local channel\n", tmp->context, tmp->exten);
ast_mutex_destroy(&tmp->lock);
free(tmp);
tmp = NULL;
} else {