aboutsummaryrefslogtreecommitdiffstats
path: root/main/astmm.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-10-29 19:21:06 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-10-29 19:21:06 +0000
commit364d312df585d5c8226766db286127cf61023d5b (patch)
tree8134f275da284f4ef8b7aaade736fae3acbd54e6 /main/astmm.c
parent6967e4a660fba930b5aa528f03f4dc229f928cf6 (diff)
Remove a lock that doesn't make any sense. The regions lock needs to be held
when traversing the list of allocated chunks so that they can be printed out to the CLI. (Thanks to eliel on #asterisk-dev for pointing this out!) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@87373 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/astmm.c')
-rw-r--r--main/astmm.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/main/astmm.c b/main/astmm.c
index 260f5d1dd..eeeaf5bd8 100644
--- a/main/astmm.c
+++ b/main/astmm.c
@@ -82,7 +82,6 @@ static struct ast_region {
(((unsigned long)(a)) % SOME_PRIME)
AST_MUTEX_DEFINE_STATIC_NOTRACKING(reglock);
-AST_MUTEX_DEFINE_STATIC(showmemorylock);
#define astmm_log(...) \
do { \
@@ -318,7 +317,7 @@ static int handle_show_memory(int fd, int argc, char *argv[])
if (argc > 3)
fn = argv[3];
- ast_mutex_lock(&showmemorylock);
+ ast_mutex_lock(&reglock);
for (x = 0; x < SOME_PRIME; x++) {
for (reg = regions[x]; reg; reg = reg->next) {
if (!fn || !strcasecmp(fn, reg->file) || !strcasecmp(fn, "anomolies")) {
@@ -344,7 +343,7 @@ static int handle_show_memory(int fd, int argc, char *argv[])
}
}
}
- ast_mutex_unlock(&showmemorylock);
+ ast_mutex_unlock(&reglock);
if (cache_len)
ast_cli(fd, "%d bytes allocated (%d in caches) in %d allocations\n", len, cache_len, count);