aboutsummaryrefslogtreecommitdiffstats
path: root/formats/format_gsm.c
diff options
context:
space:
mode:
Diffstat (limited to 'formats/format_gsm.c')
-rwxr-xr-xformats/format_gsm.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/formats/format_gsm.c b/formats/format_gsm.c
index 49d53df27..078d79d33 100755
--- a/formats/format_gsm.c
+++ b/formats/format_gsm.c
@@ -50,7 +50,7 @@ struct ast_filestream {
};
-static pthread_mutex_t gsm_lock = AST_MUTEX_INITIALIZER;
+static ast_mutex_t gsm_lock = AST_MUTEX_INITIALIZER;
static int glistcnt = 0;
static char *name = "gsm";
@@ -65,7 +65,7 @@ static struct ast_filestream *gsm_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(&gsm_lock)) {
+ if (ast_mutex_lock(&gsm_lock)) {
ast_log(LOG_WARNING, "Unable to lock gsm list\n");
free(tmp);
return NULL;
@@ -78,7 +78,7 @@ static struct ast_filestream *gsm_open(int fd)
tmp->fr.src = name;
tmp->fr.mallocd = 0;
glistcnt++;
- ast_pthread_mutex_unlock(&gsm_lock);
+ ast_mutex_unlock(&gsm_lock);
ast_update_use_count();
}
return tmp;
@@ -92,14 +92,14 @@ static struct ast_filestream *gsm_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(&gsm_lock)) {
+ if (ast_mutex_lock(&gsm_lock)) {
ast_log(LOG_WARNING, "Unable to lock gsm list\n");
free(tmp);
return NULL;
}
tmp->fd = fd;
glistcnt++;
- ast_pthread_mutex_unlock(&gsm_lock);
+ ast_mutex_unlock(&gsm_lock);
ast_update_use_count();
} else
ast_log(LOG_WARNING, "Out of memory\n");
@@ -108,12 +108,12 @@ static struct ast_filestream *gsm_rewrite(int fd, char *comment)
static void gsm_close(struct ast_filestream *s)
{
- if (ast_pthread_mutex_lock(&gsm_lock)) {
+ if (ast_mutex_lock(&gsm_lock)) {
ast_log(LOG_WARNING, "Unable to lock gsm list\n");
return;
}
glistcnt--;
- ast_pthread_mutex_unlock(&gsm_lock);
+ ast_mutex_unlock(&gsm_lock);
ast_update_use_count();
close(s->fd);
free(s);
@@ -235,12 +235,12 @@ int unload_module()
int usecount()
{
int res;
- if (ast_pthread_mutex_lock(&gsm_lock)) {
+ if (ast_mutex_lock(&gsm_lock)) {
ast_log(LOG_WARNING, "Unable to lock gsm list\n");
return -1;
}
res = glistcnt;
- ast_pthread_mutex_unlock(&gsm_lock);
+ ast_mutex_unlock(&gsm_lock);
return res;
}