mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 14:58:25 +00:00
Totally revamp thread debugging to support locating and removing deadlocks
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1310 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
|
||||
#define BUFFER_SIZE 8096 /* size for the translation buffers */
|
||||
|
||||
static pthread_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
|
||||
static ast_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
|
||||
static int localusecnt = 0;
|
||||
|
||||
static char *tdesc = "A-law and Mulaw direct Coder/Decoder";
|
||||
@@ -274,13 +274,13 @@ int
|
||||
unload_module (void)
|
||||
{
|
||||
int res;
|
||||
ast_pthread_mutex_lock (&localuser_lock);
|
||||
ast_mutex_lock (&localuser_lock);
|
||||
res = ast_unregister_translator (&ulawtoalaw);
|
||||
if (!res)
|
||||
res = ast_unregister_translator (&alawtoulaw);
|
||||
if (localusecnt)
|
||||
res = -1;
|
||||
ast_pthread_mutex_unlock (&localuser_lock);
|
||||
ast_mutex_unlock (&localuser_lock);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#define BUFFER_SIZE 8096 /* size for the translation buffers */
|
||||
|
||||
static pthread_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
|
||||
static ast_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
|
||||
static int localusecnt = 0;
|
||||
|
||||
static char *tdesc = "Adaptive Differential PCM Coder/Decoder";
|
||||
@@ -500,13 +500,13 @@ int
|
||||
unload_module (void)
|
||||
{
|
||||
int res;
|
||||
ast_pthread_mutex_lock (&localuser_lock);
|
||||
ast_mutex_lock (&localuser_lock);
|
||||
res = ast_unregister_translator (&lintoadpcm);
|
||||
if (!res)
|
||||
res = ast_unregister_translator (&adpcmtolin);
|
||||
if (localusecnt)
|
||||
res = -1;
|
||||
ast_pthread_mutex_unlock (&localuser_lock);
|
||||
ast_mutex_unlock (&localuser_lock);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#define BUFFER_SIZE 8096 /* size for the translation buffers */
|
||||
|
||||
static pthread_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
|
||||
static ast_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
|
||||
static int localusecnt = 0;
|
||||
|
||||
static char *tdesc = "A-law Coder/Decoder";
|
||||
@@ -332,13 +332,13 @@ int
|
||||
unload_module (void)
|
||||
{
|
||||
int res;
|
||||
ast_pthread_mutex_lock (&localuser_lock);
|
||||
ast_mutex_lock (&localuser_lock);
|
||||
res = ast_unregister_translator (&lintoalaw);
|
||||
if (!res)
|
||||
res = ast_unregister_translator (&alawtolin);
|
||||
if (localusecnt)
|
||||
res = -1;
|
||||
ast_pthread_mutex_unlock (&localuser_lock);
|
||||
ast_mutex_unlock (&localuser_lock);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
#include "slin_g723_ex.h"
|
||||
#include "g723_slin_ex.h"
|
||||
|
||||
static pthread_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
|
||||
static ast_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
|
||||
static int localusecnt=0;
|
||||
|
||||
#ifdef ANNEX_B
|
||||
@@ -363,13 +363,13 @@ static struct ast_translator lintog723 =
|
||||
int unload_module(void)
|
||||
{
|
||||
int res;
|
||||
ast_pthread_mutex_lock(&localuser_lock);
|
||||
ast_mutex_lock(&localuser_lock);
|
||||
res = ast_unregister_translator(&lintog723);
|
||||
if (!res)
|
||||
res = ast_unregister_translator(&g723tolin);
|
||||
if (localusecnt)
|
||||
res = -1;
|
||||
ast_pthread_mutex_unlock(&localuser_lock);
|
||||
ast_mutex_unlock(&localuser_lock);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include "slin_gsm_ex.h"
|
||||
#include "gsm_slin_ex.h"
|
||||
|
||||
static pthread_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
|
||||
static ast_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
|
||||
static int localusecnt=0;
|
||||
|
||||
static char *tdesc = "GSM/PCM16 (signed linear) Codec Translator";
|
||||
@@ -253,13 +253,13 @@ static struct ast_translator lintogsm =
|
||||
int unload_module(void)
|
||||
{
|
||||
int res;
|
||||
ast_pthread_mutex_lock(&localuser_lock);
|
||||
ast_mutex_lock(&localuser_lock);
|
||||
res = ast_unregister_translator(&lintogsm);
|
||||
if (!res)
|
||||
res = ast_unregister_translator(&gsmtolin);
|
||||
if (localusecnt)
|
||||
res = -1;
|
||||
ast_pthread_mutex_unlock(&localuser_lock);
|
||||
ast_mutex_unlock(&localuser_lock);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
#define USE_ILBC_ENHANCER 0
|
||||
|
||||
static pthread_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
|
||||
static ast_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
|
||||
static int localusecnt=0;
|
||||
|
||||
static char *tdesc = "iLBC/PCM16 (signed linear) Codec Translator";
|
||||
@@ -245,13 +245,13 @@ static struct ast_translator lintoilbc =
|
||||
int unload_module(void)
|
||||
{
|
||||
int res;
|
||||
ast_pthread_mutex_lock(&localuser_lock);
|
||||
ast_mutex_lock(&localuser_lock);
|
||||
res = ast_unregister_translator(&lintoilbc);
|
||||
if (!res)
|
||||
res = ast_unregister_translator(&ilbctolin);
|
||||
if (localusecnt)
|
||||
res = -1;
|
||||
ast_pthread_mutex_unlock(&localuser_lock);
|
||||
ast_mutex_unlock(&localuser_lock);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
#define LPC10_BYTES_IN_COMPRESSED_FRAME (LPC10_BITS_IN_COMPRESSED_FRAME + 7)/8
|
||||
|
||||
static pthread_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
|
||||
static ast_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
|
||||
static int localusecnt=0;
|
||||
|
||||
static char *tdesc = "LPC10 2.4kbps (signed linear) Voice Coder";
|
||||
@@ -330,13 +330,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#define MAX_FRAME_SIZE 1441
|
||||
#define MAX_OUTPUT_LEN 2304
|
||||
|
||||
static pthread_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
|
||||
static ast_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
|
||||
static int localusecnt=0;
|
||||
|
||||
static char *tdesc = "MP3/PCM16 (signed linear) Translator (Decoder only)";
|
||||
@@ -287,11 +287,11 @@ static struct ast_translator mp3tolin =
|
||||
int unload_module(void)
|
||||
{
|
||||
int res;
|
||||
ast_pthread_mutex_lock(&localuser_lock);
|
||||
ast_mutex_lock(&localuser_lock);
|
||||
res = ast_unregister_translator(&mp3tolin);
|
||||
if (localusecnt)
|
||||
res = -1;
|
||||
ast_pthread_mutex_unlock(&localuser_lock);
|
||||
ast_mutex_unlock(&localuser_lock);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "slin_speex_ex.h"
|
||||
#include "speex_slin_ex.h"
|
||||
|
||||
static pthread_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
|
||||
static ast_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
|
||||
static int localusecnt=0;
|
||||
|
||||
static char *tdesc = "Speex/PCM16 (signed linear) Codec Translator";
|
||||
@@ -275,13 +275,13 @@ static struct ast_translator lintospeex =
|
||||
int unload_module(void)
|
||||
{
|
||||
int res;
|
||||
ast_pthread_mutex_lock(&localuser_lock);
|
||||
ast_mutex_lock(&localuser_lock);
|
||||
res = ast_unregister_translator(&lintospeex);
|
||||
if (!res)
|
||||
res = ast_unregister_translator(&speextolin);
|
||||
if (localusecnt)
|
||||
res = -1;
|
||||
ast_pthread_mutex_unlock(&localuser_lock);
|
||||
ast_mutex_unlock(&localuser_lock);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#define BUFFER_SIZE 8096 /* size for the translation buffers */
|
||||
|
||||
static pthread_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
|
||||
static ast_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
|
||||
static int localusecnt = 0;
|
||||
|
||||
static char *tdesc = "Mu-law Coder/Decoder";
|
||||
@@ -332,13 +332,13 @@ int
|
||||
unload_module (void)
|
||||
{
|
||||
int res;
|
||||
ast_pthread_mutex_lock (&localuser_lock);
|
||||
ast_mutex_lock (&localuser_lock);
|
||||
res = ast_unregister_translator (&lintoulaw);
|
||||
if (!res)
|
||||
res = ast_unregister_translator (&ulawtolin);
|
||||
if (localusecnt)
|
||||
res = -1;
|
||||
ast_pthread_mutex_unlock (&localuser_lock);
|
||||
ast_mutex_unlock (&localuser_lock);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user