[asterisk-commits] russell: branch 1.4 r87373 - /branches/1.4/main/astmm.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Oct 29 14:21:06 CDT 2007
Author: russell
Date: Mon Oct 29 14:21:06 2007
New Revision: 87373
URL: http://svn.digium.com/view/asterisk?view=rev&rev=87373
Log:
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!)
Modified:
branches/1.4/main/astmm.c
Modified: branches/1.4/main/astmm.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/astmm.c?view=diff&rev=87373&r1=87372&r2=87373
==============================================================================
--- branches/1.4/main/astmm.c (original)
+++ branches/1.4/main/astmm.c Mon Oct 29 14:21:06 2007
@@ -82,7 +82,6 @@
(((unsigned long)(a)) % SOME_PRIME)
AST_MUTEX_DEFINE_STATIC_NOTRACKING(reglock);
-AST_MUTEX_DEFINE_STATIC(showmemorylock);
#define astmm_log(...) \
do { \
@@ -318,7 +317,7 @@
if (argc > 3)
fn = argv[3];
- ast_mutex_lock(&showmemorylock);
+ ast_mutex_lock(®lock);
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 @@
}
}
}
- ast_mutex_unlock(&showmemorylock);
+ ast_mutex_unlock(®lock);
if (cache_len)
ast_cli(fd, "%d bytes allocated (%d in caches) in %d allocations\n", len, cache_len, count);
More information about the asterisk-commits
mailing list