don't take locks when reading usecounts, they are not necessary (bug #4585)
[asterisk/asterisk.git] / formats / format_pcm_alaw.c
index b5f27be..827c142 100755 (executable)
  * the GNU General Public License
  */
  
-#include <asterisk/lock.h>
-#include <asterisk/channel.h>
-#include <asterisk/file.h>
-#include <asterisk/logger.h>
-#include <asterisk/sched.h>
-#include <asterisk/module.h>
-#include <asterisk/endian.h>
+#include <unistd.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <stdlib.h>
 #include <sys/times.h>
 #include <sys/types.h>
 #include <stdio.h>
-#include <unistd.h>
 #include <errno.h>
 #include <string.h>
 
+#include "asterisk.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
+#include "asterisk/lock.h"
+#include "asterisk/channel.h"
+#include "asterisk/file.h"
+#include "asterisk/logger.h"
+#include "asterisk/sched.h"
+#include "asterisk/module.h"
+#include "asterisk/endian.h"
+
 #define BUF_SIZE 160           /* 160 samples */
 
 /* #define REALTIME_WRITE */
@@ -294,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()