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_wav_gsm.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_wav_gsm.c')
-rwxr-xr-x | formats/format_wav_gsm.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/formats/format_wav_gsm.c b/formats/format_wav_gsm.c index a9a1e8313..fbb97d6ab 100755 --- a/formats/format_wav_gsm.c +++ b/formats/format_wav_gsm.c @@ -53,7 +53,7 @@ struct ast_filestream { }; -static pthread_mutex_t wav_lock = AST_MUTEX_INITIALIZER; +static ast_mutex_t wav_lock = AST_MUTEX_INITIALIZER; static int glistcnt = 0; static char *name = "wav49"; @@ -331,7 +331,7 @@ static struct ast_filestream *wav_open(int fd) free(tmp); return NULL; } - if (ast_pthread_mutex_lock(&wav_lock)) { + if (ast_mutex_lock(&wav_lock)) { ast_log(LOG_WARNING, "Unable to lock wav list\n"); free(tmp); return NULL; @@ -345,7 +345,7 @@ static struct ast_filestream *wav_open(int fd) tmp->fr.mallocd = 0; tmp->secondhalf = 0; glistcnt++; - ast_pthread_mutex_unlock(&wav_lock); + ast_mutex_unlock(&wav_lock); ast_update_use_count(); } return tmp; @@ -363,14 +363,14 @@ static struct ast_filestream *wav_rewrite(int fd, char *comment) free(tmp); return NULL; } - if (ast_pthread_mutex_lock(&wav_lock)) { + if (ast_mutex_lock(&wav_lock)) { ast_log(LOG_WARNING, "Unable to lock wav list\n"); free(tmp); return NULL; } tmp->fd = fd; glistcnt++; - ast_pthread_mutex_unlock(&wav_lock); + ast_mutex_unlock(&wav_lock); ast_update_use_count(); } else ast_log(LOG_WARNING, "Out of memory\n"); @@ -380,7 +380,7 @@ static struct ast_filestream *wav_rewrite(int fd, char *comment) static void wav_close(struct ast_filestream *s) { char zero = 0; - ast_pthread_mutex_unlock(&wav_lock); + ast_mutex_unlock(&wav_lock); ast_update_use_count(); /* Pad to even length */ if (s->bytes & 0x1) @@ -533,12 +533,12 @@ int unload_module() int usecount() { int res; - if (ast_pthread_mutex_lock(&wav_lock)) { + if (ast_mutex_lock(&wav_lock)) { ast_log(LOG_WARNING, "Unable to lock wav list\n"); return -1; } res = glistcnt; - ast_pthread_mutex_unlock(&wav_lock); + ast_mutex_unlock(&wav_lock); return res; } |