Remove pthread.h from source. We should be using asterisk/lock.h everywhere instead...
[asterisk/asterisk.git] / codecs / codec_lpc10.c
index 3c5d2c3..9ec7a7e 100755 (executable)
@@ -22,7 +22,6 @@
 #include <asterisk/module.h>
 #include <asterisk/logger.h>
 #include <asterisk/channel.h>
-#include <pthread.h>
 #include <fcntl.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -43,7 +42,7 @@
 
 #define LPC10_BYTES_IN_COMPRESSED_FRAME (LPC10_BITS_IN_COMPRESSED_FRAME + 7)/8
 
-static pthread_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(localuser_lock);
 static int localusecnt=0;
 
 static char *tdesc = "LPC10 2.4kbps (signed linear) Voice Coder";
@@ -330,13 +329,13 @@ static struct ast_translator lintolpc10 =
 int unload_module(void)
 {
        int res;
-       ast_pthread_mutex_lock(&localuser_lock);
+       ast_mutex_lock(&localuser_lock);
        res = ast_unregister_translator(&lintolpc10);
        if (!res)
                res = ast_unregister_translator(&lpc10tolin);
        if (localusecnt)
                res = -1;
-       ast_pthread_mutex_unlock(&localuser_lock);
+       ast_mutex_unlock(&localuser_lock);
        return res;
 }