aboutsummaryrefslogtreecommitdiffstats
path: root/astmm.c
diff options
context:
space:
mode:
authorjeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b>2004-01-11 22:36:37 +0000
committerjeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b>2004-01-11 22:36:37 +0000
commita52c2ebeebe0729306ce4c90de34f0ef59c16996 (patch)
tree6fbb1cbafe1f7ddfd5fe89f5d23323b37c6f2825 /astmm.c
parent076f5e9af89a6bfcdb23ad9d75adf08c8ce5ecde (diff)
fix deadlock issues with astmm
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1957 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'astmm.c')
-rwxr-xr-xastmm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/astmm.c b/astmm.c
index ad022faed..4738d7af3 100755
--- a/astmm.c
+++ b/astmm.c
@@ -57,6 +57,7 @@ static struct ast_region {
(((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 @@ static int handle_show_memory(int fd, int argc, char *argv[])
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 @@ static int handle_show_memory(int fd, int argc, char *argv[])
}
}
ast_cli(fd, "%d bytes allocated %d units total\n", len, count);
- ast_mutex_unlock(&reglock);
+ ast_mutex_unlock(&showmemorylock);
return RESULT_SUCCESS;
}