]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Remove a lock that doesn't make any sense. The regions lock needs to be held
authorRussell Bryant <russell@russellbryant.com>
Mon, 29 Oct 2007 19:21:06 +0000 (19:21 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 29 Oct 2007 19:21:06 +0000 (19:21 +0000)
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/branches/1.4@87373 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/astmm.c

index 260f5d1ddb185257306aec68834a693d7136d6d7..eeeaf5bd8f6b7d54948bc4c5593d96721560fda2 100644 (file)
@@ -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);