diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-08-13 15:25:16 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-08-13 15:25:16 +0000 |
commit | dbc9edcaac6ec1d2059f4c5bcd27cca6c266f5bf (patch) | |
tree | 3f2cc11c392b1496cf6518e8b6eb99e8b04417a1 /formats/format_g723.c | |
parent | 231b9aad4020331a8c68d1a2826ee1ef930ec57b (diff) |
Totally revamp thread debugging to support locating and removing deadlocks
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1310 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'formats/format_g723.c')
-rwxr-xr-x | formats/format_g723.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/formats/format_g723.c b/formats/format_g723.c index 8ce2ec266..2431d3dee 100755 --- a/formats/format_g723.c +++ b/formats/format_g723.c @@ -42,7 +42,7 @@ struct ast_filestream { }; -static pthread_mutex_t g723_lock = AST_MUTEX_INITIALIZER; +static ast_mutex_t g723_lock = AST_MUTEX_INITIALIZER; static int glistcnt = 0; static char *name = "g723sf"; @@ -56,7 +56,7 @@ static struct ast_filestream *g723_open(int fd) and be sure it's a valid file. */ struct ast_filestream *tmp; if ((tmp = malloc(sizeof(struct ast_filestream)))) { - if (ast_pthread_mutex_lock(&g723_lock)) { + if (ast_mutex_lock(&g723_lock)) { ast_log(LOG_WARNING, "Unable to lock g723 list\n"); free(tmp); return NULL; @@ -73,7 +73,7 @@ static struct ast_filestream *g723_open(int fd) tmp->orig.tv_usec = 0; tmp->orig.tv_sec = 0; glistcnt++; - ast_pthread_mutex_unlock(&g723_lock); + ast_mutex_unlock(&g723_lock); ast_update_use_count(); } return tmp; @@ -86,7 +86,7 @@ static struct ast_filestream *g723_rewrite(int fd, char *comment) and be sure it's a valid file. */ struct ast_filestream *tmp; if ((tmp = malloc(sizeof(struct ast_filestream)))) { - if (ast_pthread_mutex_lock(&g723_lock)) { + if (ast_mutex_lock(&g723_lock)) { ast_log(LOG_WARNING, "Unable to lock g723 list\n"); free(tmp); return NULL; @@ -98,7 +98,7 @@ static struct ast_filestream *g723_rewrite(int fd, char *comment) tmp->orig.tv_usec = 0; tmp->orig.tv_sec = 0; glistcnt++; - ast_pthread_mutex_unlock(&g723_lock); + ast_mutex_unlock(&g723_lock); ast_update_use_count(); } else ast_log(LOG_WARNING, "Out of memory\n"); @@ -113,7 +113,7 @@ static struct ast_frame *g723_read(struct ast_filestream *s) static void g723_close(struct ast_filestream *s) { struct ast_filestream *tmp, *tmpl = NULL; - if (ast_pthread_mutex_lock(&g723_lock)) { + if (ast_mutex_lock(&g723_lock)) { ast_log(LOG_WARNING, "Unable to lock g723 list\n"); return; } @@ -136,7 +136,7 @@ static void g723_close(struct ast_filestream *s) ast_sched_del(s->owner->sched, s->owner->streamid); s->owner->streamid = -1; } - ast_pthread_mutex_unlock(&g723_lock); + ast_mutex_unlock(&g723_lock); ast_update_use_count(); if (!tmp) ast_log(LOG_WARNING, "Freeing a filestream we don't seem to own\n"); @@ -335,7 +335,7 @@ int load_module() int unload_module() { struct ast_filestream *tmp, *tmpl; - if (ast_pthread_mutex_lock(&g723_lock)) { + if (ast_mutex_lock(&g723_lock)) { ast_log(LOG_WARNING, "Unable to lock g723 list\n"); return -1; } @@ -347,19 +347,19 @@ int unload_module() tmp = tmp->next; free(tmpl); } - ast_pthread_mutex_unlock(&g723_lock); + ast_mutex_unlock(&g723_lock); return ast_format_unregister(name); } int usecount() { int res; - if (ast_pthread_mutex_lock(&g723_lock)) { + if (ast_mutex_lock(&g723_lock)) { ast_log(LOG_WARNING, "Unable to lock g723 list\n"); return -1; } res = glistcnt; - ast_pthread_mutex_unlock(&g723_lock); + ast_mutex_unlock(&g723_lock); return res; } |