Add any missing locking calls

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1312 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2003-08-13 17:32:44 +00:00
parent e35371be2b
commit d91f72fd5f
4 changed files with 45 additions and 14 deletions

View File

@@ -91,8 +91,13 @@ retrylock:
if (ast_mutex_trylock(&other->lock)) {
/* Failed to lock. Release main lock and try again */
ast_mutex_unlock(&p->lock);
if (us)
ast_mutex_unlock(&us->lock);
if (us) {
if (ast_mutex_unlock(&us->lock)) {
ast_log(LOG_WARNING, "%s wasn't locked while sending %d/%d\n",
us->name, f->frametype, f->subclass);
us = NULL;
}
}
/* Wait just a bit */
usleep(1);
/* Only we can destroy ourselves, so we can't disappear here */