From dbc9edcaac6ec1d2059f4c5bcd27cca6c266f5bf Mon Sep 17 00:00:00 2001 From: markster Date: Wed, 13 Aug 2003 15:25:16 +0000 Subject: 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 --- image.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'image.c') 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; } -- cgit v1.2.3