summaryrefslogtreecommitdiff
path: root/formats/format_g729.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2003-08-13 15:25:16 +0000
committerMark Spencer <markster@digium.com>2003-08-13 15:25:16 +0000
commit1bb58646de07501c96c53a963820ef70f73d50c5 (patch)
tree3f2cc11c392b1496cf6518e8b6eb99e8b04417a1 /formats/format_g729.c
parent4a396046fec3026140078479ff73fe3a98728bee (diff)
Totally revamp thread debugging to support locating and removing deadlocks
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1310 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'formats/format_g729.c')
-rwxr-xr-xformats/format_g729.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/formats/format_g729.c b/formats/format_g729.c
index a2336c94b..81765985f 100755
--- a/formats/format_g729.c
+++ b/formats/format_g729.c
@@ -48,7 +48,7 @@ struct ast_filestream {
};
-static pthread_mutex_t g729_lock = AST_MUTEX_INITIALIZER;
+static ast_mutex_t g729_lock = AST_MUTEX_INITIALIZER;
static int glistcnt = 0;
static char *name = "g729";
@@ -63,7 +63,7 @@ static struct ast_filestream *g729_open(int fd)
struct ast_filestream *tmp;
if ((tmp = malloc(sizeof(struct ast_filestream)))) {
memset(tmp, 0, sizeof(struct ast_filestream));
- if (ast_pthread_mutex_lock(&g729_lock)) {
+ if (ast_mutex_lock(&g729_lock)) {
ast_log(LOG_WARNING, "Unable to lock g729 list\n");
free(tmp);
return NULL;
@@ -76,7 +76,7 @@ static struct ast_filestream *g729_open(int fd)
tmp->fr.src = name;
tmp->fr.mallocd = 0;
glistcnt++;
- ast_pthread_mutex_unlock(&g729_lock);
+ ast_mutex_unlock(&g729_lock);
ast_update_use_count();
}
return tmp;
@@ -90,14 +90,14 @@ static struct ast_filestream *g729_rewrite(int fd, char *comment)
struct ast_filestream *tmp;
if ((tmp = malloc(sizeof(struct ast_filestream)))) {
memset(tmp, 0, sizeof(struct ast_filestream));
- if (ast_pthread_mutex_lock(&g729_lock)) {
+ if (ast_mutex_lock(&g729_lock)) {
ast_log(LOG_WARNING, "Unable to lock g729 list\n");
free(tmp);
return NULL;
}
tmp->fd = fd;
glistcnt++;
- ast_pthread_mutex_unlock(&g729_lock);
+ ast_mutex_unlock(&g729_lock);
ast_update_use_count();
} else
ast_log(LOG_WARNING, "Out of memory\n");
@@ -106,12 +106,12 @@ static struct ast_filestream *g729_rewrite(int fd, char *comment)
static void g729_close(struct ast_filestream *s)
{
- if (ast_pthread_mutex_lock(&g729_lock)) {
+ if (ast_mutex_lock(&g729_lock)) {
ast_log(LOG_WARNING, "Unable to lock g729 list\n");
return;
}
glistcnt--;
- ast_pthread_mutex_unlock(&g729_lock);
+ ast_mutex_unlock(&g729_lock);
ast_update_use_count();
close(s->fd);
free(s);
@@ -226,12 +226,12 @@ int unload_module()
int usecount()
{
int res;
- if (ast_pthread_mutex_lock(&g729_lock)) {
+ if (ast_mutex_lock(&g729_lock)) {
ast_log(LOG_WARNING, "Unable to lock g729 list\n");
return -1;
}
res = glistcnt;
- ast_pthread_mutex_unlock(&g729_lock);
+ ast_mutex_unlock(&g729_lock);
return res;
}