don't use locks when reading usecounts (reading only, not writing)
authorKevin P. Fleming <kpfleming@digium.com>
Fri, 24 Jun 2005 02:15:04 +0000 (02:15 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Fri, 24 Jun 2005 02:15:04 +0000 (02:15 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5994 65c4cc65-6c06-0410-ace0-fbb531ad65f3

19 files changed:
channels/chan_agent.c
channels/chan_alsa.c
channels/chan_features.c
channels/chan_h323.c
channels/chan_iax2.c
channels/chan_local.c
channels/chan_mgcp.c
channels/chan_modem.c
channels/chan_modem_aopen.c
channels/chan_modem_bestdata.c
channels/chan_modem_i4l.c
channels/chan_nbs.c
channels/chan_oss.c
channels/chan_phone.c
channels/chan_sip.c
channels/chan_skinny.c
channels/chan_vpb.c
channels/chan_zap.c
include/asterisk/module.h

index a36957d..8c6a111 100755 (executable)
@@ -2225,11 +2225,7 @@ int unload_module()
 
 int usecount()
 {
-       int res;
-       ast_mutex_lock(&usecnt_lock);
-       res = usecnt;
-       ast_mutex_unlock(&usecnt_lock);
-       return res;
+       return usecnt;
 }
 
 char *key()
index bae02ea..bdf273e 100755 (executable)
@@ -1102,11 +1102,7 @@ char *description()
 
 int usecount()
 {
-       int res;
-       ast_mutex_lock(&usecnt_lock);
-       res = usecnt;
-       ast_mutex_unlock(&usecnt_lock);
-       return res;
+       return usecnt;
 }
 
 char *key()
index 18f7367..a031977 100755 (executable)
@@ -570,11 +570,7 @@ int unload_module()
 
 int usecount()
 {
-       int res;
-       ast_mutex_lock(&usecnt_lock);
-       res = usecnt;
-       ast_mutex_unlock(&usecnt_lock);
-       return res;
+       return usecnt;
 }
 
 char *key()
index 2f53120..671e9e4 100755 (executable)
@@ -2420,11 +2420,7 @@ int unload_module()
 
 int usecount()
 {
-       int res;
-       ast_mutex_lock(&usecnt_lock);
-       res = usecnt;
-       ast_mutex_unlock(&usecnt_lock);
-       return res;
+       return usecnt;
 }
 
 char *description()
index 09d2150..423fca5 100755 (executable)
@@ -9327,11 +9327,7 @@ char *description()
 
 int usecount()
 {
-       int res;
-       ast_mutex_lock(&usecnt_lock);
-       res = usecnt;
-       ast_mutex_unlock(&usecnt_lock);
-       return res;
+       return usecnt;
 }
 
 char *key()
index e520eda..a16e07e 100755 (executable)
@@ -585,11 +585,7 @@ int unload_module()
 
 int usecount()
 {
-       int res;
-       ast_mutex_lock(&usecnt_lock);
-       res = usecnt;
-       ast_mutex_unlock(&usecnt_lock);
-       return res;
+       return usecnt;
 }
 
 char *key()
index 3a4bcae..1b5dd63 100755 (executable)
@@ -4383,11 +4383,7 @@ int unload_module()
 
 int usecount()
 {
-       int res;
-       ast_mutex_lock(&usecnt_lock);
-       res = usecnt;
-       ast_mutex_unlock(&usecnt_lock);
-       return res;
+       return usecnt;
 }
 
 char *key()
index 25a052f..4a93f35 100755 (executable)
@@ -1085,11 +1085,7 @@ int load_module()
 
 int usecount(void)
 {
-       int res;
-       ast_mutex_lock(&usecnt_lock);
-       res = usecnt;
-       ast_mutex_unlock(&usecnt_lock);
-       return res;
+       return usecnt;
 }
 
 char *description()
index f18ded9..db8dea9 100755 (executable)
@@ -465,11 +465,7 @@ static struct ast_modem_driver aopen_driver =
 
 int usecount(void)
 {
-       int res;
-       ast_mutex_lock(&usecnt_lock);
-       res = usecnt;
-       ast_mutex_unlock(&usecnt_lock);
-       return res;
+       return usecnt;
 }
 
 int load_module(void)
index 5746b2a..b196c89 100755 (executable)
@@ -577,11 +577,7 @@ static struct ast_modem_driver bestdata_driver =
 
 int usecount(void)
 {
-       int res;
-       ast_mutex_lock(&usecnt_lock);
-       res = usecnt;
-       ast_mutex_unlock(&usecnt_lock);
-       return res;
+       return usecnt;
 }
 
 int load_module(void)
index 7d3761c..ddcf381 100755 (executable)
@@ -706,11 +706,7 @@ static struct ast_modem_driver i4l_driver =
 
 int usecount(void)
 {
-       int res;
-       ast_mutex_lock(&usecnt_lock);
-       res = usecnt;
-       ast_mutex_unlock(&usecnt_lock);
-       return res;
+       return usecnt;
 }
 
 int load_module(void)
index f298680..281925b 100755 (executable)
@@ -296,11 +296,7 @@ int load_module()
 
 int usecount()
 {
-       int res;
-       ast_mutex_lock(&usecnt_lock);
-       res = usecnt;
-       ast_mutex_unlock(&usecnt_lock);
-       return res;
+       return usecnt;
 }
 
 char *description()
index ff4e10f..c4b0510 100755 (executable)
@@ -1111,11 +1111,7 @@ char *description()
 
 int usecount()
 {
-       int res;
-       ast_mutex_lock(&usecnt_lock);
-       res = usecnt;
-       ast_mutex_unlock(&usecnt_lock);
-       return res;
+       return usecnt;
 }
 
 char *key()
index 327f25d..2611508 100755 (executable)
@@ -1392,11 +1392,7 @@ int load_module()
 
 int usecount()
 {
-       int res;
-       ast_mutex_lock(&usecnt_lock);
-       res = usecnt;
-       ast_mutex_unlock(&usecnt_lock);
-       return res;
+       return usecnt;
 }
 
 char *description()
index f18bb6c..42a0703 100755 (executable)
@@ -11598,13 +11598,7 @@ int unload_module()
 
 int usecount()
 {
-       int res;
-
-       ast_mutex_lock(&usecnt_lock);
-       res = usecnt;
-       ast_mutex_unlock(&usecnt_lock);
-
-       return res;
+       return usecnt;
 }
 
 char *key()
index 5d8cb63..6c6d464 100755 (executable)
@@ -3392,11 +3392,7 @@ int unload_module()
 
 int usecount()
 {
-       int res;
-       ast_mutex_lock(&usecnt_lock);
-       res = usecnt;
-       ast_mutex_unlock(&usecnt_lock);
-       return res;
+       return usecnt;
 }
 
 char *key()
index c67872c..e3c7b61 100755 (executable)
@@ -2962,11 +2962,7 @@ int unload_module()
 
 int usecount()
 {
-       int res;
-       ast_mutex_lock(&usecnt_lock);
-       res = usecnt;
-       ast_mutex_unlock(&usecnt_lock);
-       return res;
+       return usecnt;
 }
 
 char *description()
index eb5f861..6ad37d2 100755 (executable)
@@ -10645,11 +10645,7 @@ int reload(void)
 
 int usecount()
 {
-       int res;
-       ast_mutex_lock(&usecnt_lock);
-       res = usecnt;
-       ast_mutex_unlock(&usecnt_lock);
-       return res;
+       return usecnt;
 }
 
 char *description()
index 4889550..b6a1798 100755 (executable)
@@ -210,9 +210,7 @@ void ast_unregister_atexit(void (*func)(void));
 }
 
 #define STANDARD_USECOUNT(res) { \
-       ast_mutex_lock(&localuser_lock); \
        res = localusecnt; \
-       ast_mutex_unlock(&localuser_lock); \
 }