aboutsummaryrefslogtreecommitdiffstats
path: root/image.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-08-13 15:25:16 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-08-13 15:25:16 +0000
commitdbc9edcaac6ec1d2059f4c5bcd27cca6c266f5bf (patch)
tree3f2cc11c392b1496cf6518e8b6eb99e8b04417a1 /image.c
parent231b9aad4020331a8c68d1a2826ee1ef930ec57b (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 'image.c')
-rwxr-xr-ximage.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/image.c b/image.c
index 7ee2b080a..1b07b77b2 100755
--- a/image.c
+++ b/image.c
@@ -33,23 +33,23 @@
#include "astconf.h"
static struct ast_imager *list;
-static pthread_mutex_t listlock = AST_MUTEX_INITIALIZER;
+static ast_mutex_t listlock = AST_MUTEX_INITIALIZER;
int ast_image_register(struct ast_imager *img)
{
if (option_verbose > 1)
ast_verbose(VERBOSE_PREFIX_2 "Registered format '%s' (%s)\n", img->name, img->desc);
- ast_pthread_mutex_lock(&listlock);
+ ast_mutex_lock(&listlock);
img->next = list;
list = img;
- ast_pthread_mutex_unlock(&listlock);
+ ast_mutex_unlock(&listlock);
return 0;
}
void ast_image_unregister(struct ast_imager *img)
{
struct ast_imager *i, *prev = NULL;
- ast_pthread_mutex_lock(&listlock);
+ ast_mutex_lock(&listlock);
i = list;
while(i) {
if (i == img) {
@@ -62,7 +62,7 @@ void ast_image_unregister(struct ast_imager *img)
prev = i;
i = i->next;
}
- ast_pthread_mutex_unlock(&listlock);
+ ast_mutex_unlock(&listlock);
if (i && (option_verbose > 1))
ast_verbose(VERBOSE_PREFIX_2 "Registered format '%s' (%s)\n", img->name, img->desc);
}
@@ -112,7 +112,7 @@ struct ast_frame *ast_read_image(char *filename, char *preflang, int format)
int len=0;
struct ast_frame *f = NULL;
#if 0 /* We need to have some sort of read-only lock */
- ast_pthread_mutex_lock(&listlock);
+ ast_mutex_lock(&listlock);
#endif
i = list;
while(!found && i) {
@@ -152,7 +152,7 @@ struct ast_frame *ast_read_image(char *filename, char *preflang, int format)
} else
ast_log(LOG_WARNING, "Image file '%s' not found\n", filename);
#if 0
- ast_pthread_mutex_unlock(&listlock);
+ ast_mutex_unlock(&listlock);
#endif
return f;
}