don't take locks when reading usecounts, they are not necessary (bug #4585)
authorKevin P. Fleming <kpfleming@digium.com>
Thu, 23 Jun 2005 17:30:56 +0000 (17:30 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Thu, 23 Jun 2005 17:30:56 +0000 (17:30 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5983 65c4cc65-6c06-0410-ace0-fbb531ad65f3

12 files changed:
formats/format_g723.c
formats/format_g726.c
formats/format_g729.c
formats/format_gsm.c
formats/format_h263.c
formats/format_ilbc.c
formats/format_pcm.c
formats/format_pcm_alaw.c
formats/format_sln.c
formats/format_vox.c
formats/format_wav.c
formats/format_wav_gsm.c

index d0e1b23..91187c3 100755 (executable)
@@ -249,14 +249,7 @@ int unload_module()
 
 int usecount()
 {
-       int res;
-       if (ast_mutex_lock(&g723_lock)) {
-               ast_log(LOG_WARNING, "Unable to lock g723 list\n");
-               return -1;
-       }
-       res = glistcnt;
-       ast_mutex_unlock(&g723_lock);
-       return res;
+       return glistcnt;
 }
 
 char *description()
index 4813a72..a71c122 100755 (executable)
@@ -482,14 +482,7 @@ int unload_module()
 
 int usecount()
 {
-       int res;
-       if (ast_mutex_lock(&g726_lock)) {
-               ast_log(LOG_WARNING, "Unable to lock g726 list.\n");
-               return -1;
-       }
-       res = glistcnt;
-       ast_mutex_unlock(&g726_lock);
-       return res;
+       return glistcnt;
 }
 
 char *description()
index 19e6809..d28098f 100755 (executable)
@@ -229,14 +229,7 @@ int unload_module()
 
 int usecount()
 {
-       int res;
-       if (ast_mutex_lock(&g729_lock)) {
-               ast_log(LOG_WARNING, "Unable to lock g729 list\n");
-               return -1;
-       }
-       res = glistcnt;
-       ast_mutex_unlock(&g729_lock);
-       return res;
+       return glistcnt;
 }
 
 char *description()
index 01fb2a1..43a2bb6 100755 (executable)
@@ -252,14 +252,7 @@ int unload_module()
 
 int usecount()
 {
-       int res;
-       if (ast_mutex_lock(&gsm_lock)) {
-               ast_log(LOG_WARNING, "Unable to lock gsm list\n");
-               return -1;
-       }
-       res = glistcnt;
-       ast_mutex_unlock(&gsm_lock);
-       return res;
+       return glistcnt;
 }
 
 char *description()
index 990acbe..b98ed19 100755 (executable)
@@ -250,14 +250,7 @@ int unload_module()
 
 int usecount()
 {
-       int res;
-       if (ast_mutex_lock(&h263_lock)) {
-               ast_log(LOG_WARNING, "Unable to lock h263 list\n");
-               return -1;
-       }
-       res = glistcnt;
-       ast_mutex_unlock(&h263_lock);
-       return res;
+       return glistcnt;
 }
 
 char *description()
index a690f26..1d4388a 100755 (executable)
@@ -231,14 +231,7 @@ int unload_module()
 
 int usecount()
 {
-       int res;
-       if (ast_mutex_lock(&ilbc_lock)) {
-               ast_log(LOG_WARNING, "Unable to lock ilbc list\n");
-               return -1;
-       }
-       res = glistcnt;
-       ast_mutex_unlock(&ilbc_lock);
-       return res;
+       return glistcnt;
 }
 
 char *description()
index 5c28fe3..cf16635 100755 (executable)
@@ -219,14 +219,7 @@ int unload_module()
 
 int usecount()
 {
-       int res;
-       if (ast_mutex_lock(&pcm_lock)) {
-               ast_log(LOG_WARNING, "Unable to lock pcm list\n");
-               return -1;
-       }
-       res = glistcnt;
-       ast_mutex_unlock(&pcm_lock);
-       return res;
+       return glistcnt;
 }
 
 char *description()
index b5de9f9..827c142 100755 (executable)
@@ -299,14 +299,7 @@ int unload_module()
 
 int usecount()
 {
-       int res;
-       if (ast_mutex_lock(&pcm_lock)) {
-               ast_log(LOG_WARNING, "Unable to lock pcm list\n");
-               return -1;
-       }
-       res = glistcnt;
-       ast_mutex_unlock(&pcm_lock);
-       return res;
+       return glistcnt;
 }
 
 char *description()
index b7b309c..ab4d347 100755 (executable)
@@ -218,14 +218,7 @@ int unload_module()
 
 int usecount()
 {
-       int res;
-       if (ast_mutex_lock(&slinear_lock)) {
-               ast_log(LOG_WARNING, "Unable to lock slinear list\n");
-               return -1;
-       }
-       res = glistcnt;
-       ast_mutex_unlock(&slinear_lock);
-       return res;
+       return glistcnt;
 }
 
 char *description()
index e8f9218..a3aa6ce 100755 (executable)
@@ -222,14 +222,7 @@ int unload_module()
 
 int usecount()
 {
-       int res;
-       if (ast_mutex_lock(&vox_lock)) {
-               ast_log(LOG_WARNING, "Unable to lock vox list\n");
-               return -1;
-       }
-       res = glistcnt;
-       ast_mutex_unlock(&vox_lock);
-       return res;
+       return glistcnt;
 }
 
 char *description()
index 6e92467..182e40c 100755 (executable)
@@ -574,14 +574,7 @@ int unload_module()
 
 int usecount()
 {
-       int res;
-       if (ast_mutex_lock(&wav_lock)) {
-               ast_log(LOG_WARNING, "Unable to lock wav list\n");
-               return -1;
-       }
-       res = glistcnt;
-       ast_mutex_unlock(&wav_lock);
-       return res;
+       return glistcnt;
 }
 
 char *description()
index 866c5f5..fd6d787 100755 (executable)
@@ -555,14 +555,7 @@ int unload_module()
 
 int usecount()
 {
-       int res;
-       if (ast_mutex_lock(&wav_lock)) {
-               ast_log(LOG_WARNING, "Unable to lock wav list\n");
-               return -1;
-       }
-       res = glistcnt;
-       ast_mutex_unlock(&wav_lock);
-       return res;
+       return glistcnt;
 }
 
 char *description()