don't take locks when reading usecounts, they are not necessary (bug #4585)
[asterisk/asterisk.git] / formats / format_pcm_alaw.c
index f53deb4..827c142 100755 (executable)
@@ -11,6 +11,7 @@
  * the GNU General Public License
  */
  
+#include <unistd.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <stdlib.h>
@@ -18,7 +19,6 @@
 #include <sys/times.h>
 #include <sys/types.h>
 #include <stdio.h>
-#include <unistd.h>
 #include <errno.h>
 #include <string.h>
 
@@ -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()