]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
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 a36957dd705e4429e22cecde568a5423c5979665..8c6a1115d060bf543269b1174dcf48b9eb98359e 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 bae02ea7343f4c4abd33c0f352d90c1c203e5b67..bdf273ec027bd3ad42b51f4369b34ed3332cad18 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 18f7367cf42812b4fe298905a1c4272097fb2e76..a03197778573bd923f5807aa23be6b163cfa8c04 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 2f531200558a10b4f186ecada5255a24471760e2..671e9e40177150886f9d039a26bccff0e2fa5085 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 09d21503d9bc7134b99a7d10a400b94548d9fba5..423fca54235c6dbe5234fe6ed89cdbb1b36741ef 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 e520edaede8b1ecd59bd3fdde12fe35d02ef1538..a16e07ed2eba6ee5f1071fbf9b99f843d2484574 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 3a4bcaeb16d9e4ec02ee26385c5e5e972c6c0b2c..1b5dd6358b4182900ad3ca32a99782de9ef4a36e 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 25a052f6b9bc7a98bad52d605dfb07eddd0cafe7..4a93f35d0c17c301ff11242a721fe9699c1ec912 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 f18ded9fc4ea3a2fafacc57cebf55af46dae77db..db8dea9439d54f41bf9be3af3b2be9e2638247fd 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 5746b2aa4575465d8edc1508041954c5b9d41cb3..b196c89ed89aa7174d80fe17b2934e13b63aff7a 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 7d3761c2c6681164cf7afd722a816714a08f2daa..ddcf3810bebc5cd9351e120448d400292c7f1a1f 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 f298680c333b651277015edd3bafe7df77e84788..281925ba392834300326b420e9174c91be575576 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 ff4e10f2781bcae53a2900ad427ce719e5c056f9..c4b05101e77383639d972a4cd1fa1a2e5dda8d08 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 327f25d36566aae8cb7b2eee4a848e02d63cc333..2611508b7340346789977007383b6da5c775ae2e 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 f18bb6c5aa78811273af6654183dfbd1577d75c6..42a0703a5a6faf6a3ea7dfed1895cad7671ecdbe 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 5d8cb63c91a5a29df85821480b138c7a1802b3fe..6c6d4645449139469df758d8a1466368889249d4 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 c67872c72b9b0d7e93d0d22e2a96e1083253cf4e..e3c7b61c52dea16f564ed2dd5b227deda034a1f5 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 eb5f861cfb7d571293a46b8310fda401beb3609d..6ad37d2bc300f9d436ed59b20726327f59e6e3e2 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 4889550a1126ab1e16c735812480705a0a928e6b..b6a17982c2effde5849fd24ef4bca75ecfc7177c 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); \
 }