aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xchannels/chan_agent.c6
-rwxr-xr-xchannels/chan_alsa.c6
-rwxr-xr-xchannels/chan_features.c6
-rwxr-xr-xchannels/chan_h323.c6
-rwxr-xr-xchannels/chan_iax2.c6
-rwxr-xr-xchannels/chan_local.c6
-rwxr-xr-xchannels/chan_mgcp.c6
-rwxr-xr-xchannels/chan_modem.c6
-rwxr-xr-xchannels/chan_modem_aopen.c6
-rwxr-xr-xchannels/chan_modem_bestdata.c6
-rwxr-xr-xchannels/chan_modem_i4l.c6
-rwxr-xr-xchannels/chan_nbs.c6
-rwxr-xr-xchannels/chan_oss.c6
-rwxr-xr-xchannels/chan_phone.c6
-rwxr-xr-xchannels/chan_sip.c8
-rwxr-xr-xchannels/chan_skinny.c6
-rwxr-xr-xchannels/chan_vpb.c6
-rwxr-xr-xchannels/chan_zap.c6
-rwxr-xr-xinclude/asterisk/module.h2
19 files changed, 18 insertions, 94 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index a36957dd7..8c6a1115d 100755
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -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()
diff --git a/channels/chan_alsa.c b/channels/chan_alsa.c
index bae02ea73..bdf273ec0 100755
--- a/channels/chan_alsa.c
+++ b/channels/chan_alsa.c
@@ -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()
diff --git a/channels/chan_features.c b/channels/chan_features.c
index 18f7367cf..a03197778 100755
--- a/channels/chan_features.c
+++ b/channels/chan_features.c
@@ -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()
diff --git a/channels/chan_h323.c b/channels/chan_h323.c
index 2f5312005..671e9e401 100755
--- a/channels/chan_h323.c
+++ b/channels/chan_h323.c
@@ -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()
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 09d21503d..423fca542 100755
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -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()
diff --git a/channels/chan_local.c b/channels/chan_local.c
index e520edaed..a16e07ed2 100755
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -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()
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index 3a4bcaeb1..1b5dd6358 100755
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -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()
diff --git a/channels/chan_modem.c b/channels/chan_modem.c
index 25a052f6b..4a93f35d0 100755
--- a/channels/chan_modem.c
+++ b/channels/chan_modem.c
@@ -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()
diff --git a/channels/chan_modem_aopen.c b/channels/chan_modem_aopen.c
index f18ded9fc..db8dea943 100755
--- a/channels/chan_modem_aopen.c
+++ b/channels/chan_modem_aopen.c
@@ -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)
diff --git a/channels/chan_modem_bestdata.c b/channels/chan_modem_bestdata.c
index 5746b2aa4..b196c89ed 100755
--- a/channels/chan_modem_bestdata.c
+++ b/channels/chan_modem_bestdata.c
@@ -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)
diff --git a/channels/chan_modem_i4l.c b/channels/chan_modem_i4l.c
index 7d3761c2c..ddcf3810b 100755
--- a/channels/chan_modem_i4l.c
+++ b/channels/chan_modem_i4l.c
@@ -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)
diff --git a/channels/chan_nbs.c b/channels/chan_nbs.c
index f298680c3..281925ba3 100755
--- a/channels/chan_nbs.c
+++ b/channels/chan_nbs.c
@@ -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()
diff --git a/channels/chan_oss.c b/channels/chan_oss.c
index ff4e10f27..c4b05101e 100755
--- a/channels/chan_oss.c
+++ b/channels/chan_oss.c
@@ -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()
diff --git a/channels/chan_phone.c b/channels/chan_phone.c
index 327f25d36..2611508b7 100755
--- a/channels/chan_phone.c
+++ b/channels/chan_phone.c
@@ -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()
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index f18bb6c5a..42a0703a5 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -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()
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index 5d8cb63c9..6c6d46454 100755
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -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()
diff --git a/channels/chan_vpb.c b/channels/chan_vpb.c
index c67872c72..e3c7b61c5 100755
--- a/channels/chan_vpb.c
+++ b/channels/chan_vpb.c
@@ -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()
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index eb5f861cf..6ad37d2bc 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -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()
diff --git a/include/asterisk/module.h b/include/asterisk/module.h
index 4889550a1..b6a17982c 100755
--- a/include/asterisk/module.h
+++ b/include/asterisk/module.h
@@ -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); \
}