summaryrefslogtreecommitdiff
path: root/main/astmm.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2007-10-29 19:47:52 +0000
committerRussell Bryant <russell@russellbryant.com>2007-10-29 19:47:52 +0000
commit70db49ae2f8229ed4e6495051b9f83788c1f6f3b (patch)
treefd938a5af969d95abf118677fc3d2f0031f9b325 /main/astmm.c
parent230e7f0ee09205f656281ee7a77a9eba419d3979 (diff)
Merged revisions 87373 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r87373 | russell | 2007-10-29 14:21:06 -0500 (Mon, 29 Oct 2007) | 5 lines 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: https://origsvn.digium.com/svn/asterisk/trunk@87392 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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 4bd4a6b75..1eee41df9 100644
--- a/main/astmm.c
+++ b/main/astmm.c
@@ -84,7 +84,6 @@ static struct ast_region {
/*! Tracking this mutex will cause infinite recursion, as the mutex tracking
* code allocates memory */
AST_MUTEX_DEFINE_STATIC_NOTRACKING(reglock);
-AST_MUTEX_DEFINE_STATIC(showmemorylock);
#define astmm_log(...) \
do { \
@@ -333,7 +332,7 @@ static char *handle_memory_show(struct ast_cli_entry *e, int cmd, struct ast_cli
if (a->argc > 3)
fn = a->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")) {
@@ -359,7 +358,7 @@ static char *handle_memory_show(struct ast_cli_entry *e, int cmd, struct ast_cli
}
}
}
- ast_mutex_unlock(&showmemorylock);
+ ast_mutex_unlock(&reglock);
if (cache_len)
ast_cli(a->fd, "%d bytes allocated (%d in caches) in %d allocations\n", len, cache_len, count);