Version 0.1.8 from FTP

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@263 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2001-04-03 18:38:37 +00:00
parent 832e39f98f
commit 5f80ce7975
10 changed files with 69 additions and 66 deletions

View File

@@ -58,7 +58,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 (pthread_mutex_lock(&g723_lock)) {
if (ast_pthread_mutex_lock(&g723_lock)) {
ast_log(LOG_WARNING, "Unable to lock g723 list\n");
free(tmp);
return NULL;
@@ -78,7 +78,7 @@ static struct ast_filestream *g723_open(int fd)
tmp->orig.tv_usec = 0;
tmp->orig.tv_sec = 0;
glistcnt++;
pthread_mutex_unlock(&g723_lock);
ast_pthread_mutex_unlock(&g723_lock);
ast_update_use_count();
}
return tmp;
@@ -91,7 +91,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 (pthread_mutex_lock(&g723_lock)) {
if (ast_pthread_mutex_lock(&g723_lock)) {
ast_log(LOG_WARNING, "Unable to lock g723 list\n");
free(tmp);
return NULL;
@@ -105,7 +105,7 @@ static struct ast_filestream *g723_rewrite(int fd, char *comment)
tmp->orig.tv_usec = 0;
tmp->orig.tv_sec = 0;
glistcnt++;
pthread_mutex_unlock(&g723_lock);
ast_pthread_mutex_unlock(&g723_lock);
ast_update_use_count();
} else
ast_log(LOG_WARNING, "Out of memory\n");
@@ -120,7 +120,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 (pthread_mutex_lock(&g723_lock)) {
if (ast_pthread_mutex_lock(&g723_lock)) {
ast_log(LOG_WARNING, "Unable to lock g723 list\n");
return;
}
@@ -143,7 +143,7 @@ static void g723_close(struct ast_filestream *s)
ast_sched_del(s->owner->sched, s->owner->streamid);
s->owner->streamid = -1;
}
pthread_mutex_unlock(&g723_lock);
ast_pthread_mutex_unlock(&g723_lock);
ast_update_use_count();
if (!tmp)
ast_log(LOG_WARNING, "Freeing a filestream we don't seem to own\n");
@@ -317,7 +317,7 @@ int load_module()
int unload_module()
{
struct ast_filestream *tmp, *tmpl;
if (pthread_mutex_lock(&g723_lock)) {
if (ast_pthread_mutex_lock(&g723_lock)) {
ast_log(LOG_WARNING, "Unable to lock g723 list\n");
return -1;
}
@@ -329,19 +329,19 @@ int unload_module()
tmp = tmp->next;
free(tmpl);
}
pthread_mutex_unlock(&g723_lock);
ast_pthread_mutex_unlock(&g723_lock);
return ast_format_unregister(name);
}
int usecount()
{
int res;
if (pthread_mutex_lock(&g723_lock)) {
if (ast_pthread_mutex_lock(&g723_lock)) {
ast_log(LOG_WARNING, "Unable to lock g723 list\n");
return -1;
}
res = glistcnt;
pthread_mutex_unlock(&g723_lock);
ast_pthread_mutex_unlock(&g723_lock);
return res;
}

View File

@@ -64,7 +64,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 (pthread_mutex_lock(&gsm_lock)) {
if (ast_pthread_mutex_lock(&gsm_lock)) {
ast_log(LOG_WARNING, "Unable to lock gsm list\n");
free(tmp);
return NULL;
@@ -81,7 +81,7 @@ static struct ast_filestream *gsm_open(int fd)
tmp->fr.mallocd = 0;
tmp->lasttimeout = -1;
glistcnt++;
pthread_mutex_unlock(&gsm_lock);
ast_pthread_mutex_unlock(&gsm_lock);
ast_update_use_count();
}
return tmp;
@@ -95,7 +95,7 @@ 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 (pthread_mutex_lock(&gsm_lock)) {
if (ast_pthread_mutex_lock(&gsm_lock)) {
ast_log(LOG_WARNING, "Unable to lock gsm list\n");
free(tmp);
return NULL;
@@ -106,7 +106,7 @@ static struct ast_filestream *gsm_rewrite(int fd, char *comment)
tmp->owner = NULL;
tmp->lasttimeout = -1;
glistcnt++;
pthread_mutex_unlock(&gsm_lock);
ast_pthread_mutex_unlock(&gsm_lock);
ast_update_use_count();
} else
ast_log(LOG_WARNING, "Out of memory\n");
@@ -121,7 +121,7 @@ static struct ast_frame *gsm_read(struct ast_filestream *s)
static void gsm_close(struct ast_filestream *s)
{
struct ast_filestream *tmp, *tmpl = NULL;
if (pthread_mutex_lock(&gsm_lock)) {
if (ast_pthread_mutex_lock(&gsm_lock)) {
ast_log(LOG_WARNING, "Unable to lock gsm list\n");
return;
}
@@ -144,7 +144,7 @@ static void gsm_close(struct ast_filestream *s)
ast_sched_del(s->owner->sched, s->owner->streamid);
s->owner->streamid = -1;
}
pthread_mutex_unlock(&gsm_lock);
ast_pthread_mutex_unlock(&gsm_lock);
ast_update_use_count();
if (!tmp)
ast_log(LOG_WARNING, "Freeing a filestream we don't seem to own\n");
@@ -263,7 +263,7 @@ int load_module()
int unload_module()
{
struct ast_filestream *tmp, *tmpl;
if (pthread_mutex_lock(&gsm_lock)) {
if (ast_pthread_mutex_lock(&gsm_lock)) {
ast_log(LOG_WARNING, "Unable to lock gsm list\n");
return -1;
}
@@ -275,19 +275,19 @@ int unload_module()
tmp = tmp->next;
free(tmpl);
}
pthread_mutex_unlock(&gsm_lock);
ast_pthread_mutex_unlock(&gsm_lock);
return ast_format_unregister(name);
}
int usecount()
{
int res;
if (pthread_mutex_lock(&gsm_lock)) {
if (ast_pthread_mutex_lock(&gsm_lock)) {
ast_log(LOG_WARNING, "Unable to lock gsm list\n");
return -1;
}
res = glistcnt;
pthread_mutex_unlock(&gsm_lock);
ast_pthread_mutex_unlock(&gsm_lock);
return res;
}

View File

@@ -172,7 +172,7 @@ static struct ast_filestream *vox_open(int fd)
struct ast_filestream *tmp;
if ((tmp = malloc(sizeof(struct ast_filestream)))) {
memset(tmp, 0, sizeof(struct ast_filestream));
if (pthread_mutex_lock(&vox_lock)) {
if (ast_pthread_mutex_lock(&vox_lock)) {
ast_log(LOG_WARNING, "Unable to lock vox list\n");
free(tmp);
return NULL;
@@ -189,7 +189,7 @@ static struct ast_filestream *vox_open(int fd)
tmp->fr.mallocd = 0;
tmp->lasttimeout = -1;
glistcnt++;
pthread_mutex_unlock(&vox_lock);
ast_pthread_mutex_unlock(&vox_lock);
ast_update_use_count();
}
return tmp;
@@ -203,7 +203,7 @@ static struct ast_filestream *vox_rewrite(int fd, char *comment)
struct ast_filestream *tmp;
if ((tmp = malloc(sizeof(struct ast_filestream)))) {
memset(tmp, 0, sizeof(struct ast_filestream));
if (pthread_mutex_lock(&vox_lock)) {
if (ast_pthread_mutex_lock(&vox_lock)) {
ast_log(LOG_WARNING, "Unable to lock vox list\n");
free(tmp);
return NULL;
@@ -214,7 +214,7 @@ static struct ast_filestream *vox_rewrite(int fd, char *comment)
tmp->owner = NULL;
tmp->lasttimeout = -1;
glistcnt++;
pthread_mutex_unlock(&vox_lock);
ast_pthread_mutex_unlock(&vox_lock);
ast_update_use_count();
} else
ast_log(LOG_WARNING, "Out of memory\n");
@@ -229,7 +229,7 @@ static struct ast_frame *vox_read(struct ast_filestream *s)
static void vox_close(struct ast_filestream *s)
{
struct ast_filestream *tmp, *tmpl = NULL;
if (pthread_mutex_lock(&vox_lock)) {
if (ast_pthread_mutex_lock(&vox_lock)) {
ast_log(LOG_WARNING, "Unable to lock vox list\n");
return;
}
@@ -252,7 +252,7 @@ static void vox_close(struct ast_filestream *s)
ast_sched_del(s->owner->sched, s->owner->streamid);
s->owner->streamid = -1;
}
pthread_mutex_unlock(&vox_lock);
ast_pthread_mutex_unlock(&vox_lock);
ast_update_use_count();
if (!tmp)
ast_log(LOG_WARNING, "Freeing a filestream we don't seem to own\n");
@@ -382,7 +382,7 @@ int load_module()
int unload_module()
{
struct ast_filestream *tmp, *tmpl;
if (pthread_mutex_lock(&vox_lock)) {
if (ast_pthread_mutex_lock(&vox_lock)) {
ast_log(LOG_WARNING, "Unable to lock vox list\n");
return -1;
}
@@ -394,19 +394,19 @@ int unload_module()
tmp = tmp->next;
free(tmpl);
}
pthread_mutex_unlock(&vox_lock);
ast_pthread_mutex_unlock(&vox_lock);
return ast_format_unregister(name);
}
int usecount()
{
int res;
if (pthread_mutex_lock(&vox_lock)) {
if (ast_pthread_mutex_lock(&vox_lock)) {
ast_log(LOG_WARNING, "Unable to lock vox list\n");
return -1;
}
res = glistcnt;
pthread_mutex_unlock(&vox_lock);
ast_pthread_mutex_unlock(&vox_lock);
return res;
}

View File

@@ -327,7 +327,7 @@ static struct ast_filestream *wav_open(int fd)
free(tmp);
return NULL;
}
if (pthread_mutex_lock(&wav_lock)) {
if (ast_pthread_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->secondhalf = 0;
tmp->lasttimeout = -1;
glistcnt++;
pthread_mutex_unlock(&wav_lock);
ast_pthread_mutex_unlock(&wav_lock);
ast_update_use_count();
}
return tmp;
@@ -363,7 +363,7 @@ static struct ast_filestream *wav_rewrite(int fd, char *comment)
free(tmp);
return NULL;
}
if (pthread_mutex_lock(&wav_lock)) {
if (ast_pthread_mutex_lock(&wav_lock)) {
ast_log(LOG_WARNING, "Unable to lock wav list\n");
free(tmp);
return NULL;
@@ -374,7 +374,7 @@ static struct ast_filestream *wav_rewrite(int fd, char *comment)
tmp->owner = NULL;
tmp->lasttimeout = -1;
glistcnt++;
pthread_mutex_unlock(&wav_lock);
ast_pthread_mutex_unlock(&wav_lock);
ast_update_use_count();
} else
ast_log(LOG_WARNING, "Out of memory\n");
@@ -390,7 +390,7 @@ static void wav_close(struct ast_filestream *s)
{
struct ast_filestream *tmp, *tmpl = NULL;
char zero = 0;
if (pthread_mutex_lock(&wav_lock)) {
if (ast_pthread_mutex_lock(&wav_lock)) {
ast_log(LOG_WARNING, "Unable to lock wav list\n");
return;
}
@@ -413,7 +413,7 @@ static void wav_close(struct ast_filestream *s)
ast_sched_del(s->owner->sched, s->owner->streamid);
s->owner->streamid = -1;
}
pthread_mutex_unlock(&wav_lock);
ast_pthread_mutex_unlock(&wav_lock);
ast_update_use_count();
if (!tmp)
ast_log(LOG_WARNING, "Freeing a filestream we don't seem to own\n");
@@ -551,7 +551,7 @@ int load_module()
int unload_module()
{
struct ast_filestream *tmp, *tmpl;
if (pthread_mutex_lock(&wav_lock)) {
if (ast_pthread_mutex_lock(&wav_lock)) {
ast_log(LOG_WARNING, "Unable to lock wav list\n");
return -1;
}
@@ -563,19 +563,19 @@ int unload_module()
tmp = tmp->next;
free(tmpl);
}
pthread_mutex_unlock(&wav_lock);
ast_pthread_mutex_unlock(&wav_lock);
return ast_format_unregister(name);
}
int usecount()
{
int res;
if (pthread_mutex_lock(&wav_lock)) {
if (ast_pthread_mutex_lock(&wav_lock)) {
ast_log(LOG_WARNING, "Unable to lock wav list\n");
return -1;
}
res = glistcnt;
pthread_mutex_unlock(&wav_lock);
ast_pthread_mutex_unlock(&wav_lock);
return res;
}