[Asterisk-cvs] asterisk astmm.c,1.6,1.7

jeremy at lists.digium.com jeremy at lists.digium.com
Sun Jan 11 16:44:51 CST 2004


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv15976

Modified Files:
	astmm.c 
Log Message:
fix deadlock issues with astmm


Index: astmm.c
===================================================================
RCS file: /usr/cvsroot/asterisk/astmm.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- astmm.c	21 Aug 2003 01:06:52 -0000	1.6
+++ astmm.c	11 Jan 2004 22:36:37 -0000	1.7
@@ -57,6 +57,7 @@
 	(((unsigned long)(a)) % SOME_PRIME)
 	
 static ast_mutex_t reglock = AST_MUTEX_INITIALIZER;
+static ast_mutex_t showmemorylock = AST_MUTEX_INITIALIZER;
 
 static inline void *__ast_alloc_region(size_t size, int which, const char *file, int lineno, const char *func)
 {
@@ -227,7 +228,7 @@
 		fn = argv[3];
 
 	/* try to lock applications list ... */
-	ast_mutex_lock(&reglock);
+	ast_mutex_lock(&showmemorylock);
 
 	for (x=0;x<SOME_PRIME;x++) {
 		reg = regions[x];
@@ -241,7 +242,7 @@
 		}
 	}
 	ast_cli(fd, "%d bytes allocated %d units total\n", len, count);
-	ast_mutex_unlock(&reglock);
+	ast_mutex_unlock(&showmemorylock);
 	return RESULT_SUCCESS;
 }
 




More information about the svn-commits mailing list