diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-08-13 15:25:16 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-08-13 15:25:16 +0000 |
commit | dbc9edcaac6ec1d2059f4c5bcd27cca6c266f5bf (patch) | |
tree | 3f2cc11c392b1496cf6518e8b6eb99e8b04417a1 /autoservice.c | |
parent | 231b9aad4020331a8c68d1a2826ee1ef930ec57b (diff) |
Totally revamp thread debugging to support locating and removing deadlocks
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1310 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'autoservice.c')
-rwxr-xr-x | autoservice.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/autoservice.c b/autoservice.c index 5f15c244c..fc81c483b 100755 --- a/autoservice.c +++ b/autoservice.c @@ -36,7 +36,7 @@ #define MAX_AUTOMONS 256 -static pthread_mutex_t autolock = AST_MUTEX_INITIALIZER; +static ast_mutex_t autolock = AST_MUTEX_INITIALIZER; struct asent { struct ast_channel *chan; @@ -56,7 +56,7 @@ static void *autoservice_run(void *ign) struct ast_frame *f; for(;;) { x = 0; - ast_pthread_mutex_lock(&autolock); + ast_mutex_lock(&autolock); as = aslist; while(as) { if (!as->chan->_softhangup) { @@ -67,7 +67,7 @@ static void *autoservice_run(void *ign) } as = as->next; } - ast_pthread_mutex_unlock(&autolock); + ast_mutex_unlock(&autolock); /* if (!aslist) break; */ @@ -89,7 +89,7 @@ int ast_autoservice_start(struct ast_channel *chan) int res = -1; struct asent *as; int needstart; - ast_pthread_mutex_lock(&autolock); + ast_mutex_lock(&autolock); needstart = (asthread == -1) ? 1 : 0 /* aslist ? 0 : 1 */; as = aslist; while(as) { @@ -116,7 +116,7 @@ int ast_autoservice_start(struct ast_channel *chan) } } } - ast_pthread_mutex_unlock(&autolock); + ast_mutex_unlock(&autolock); return res; } @@ -124,7 +124,7 @@ int ast_autoservice_stop(struct ast_channel *chan) { int res = -1; struct asent *as, *prev; - ast_pthread_mutex_lock(&autolock); + ast_mutex_lock(&autolock); as = aslist; prev = NULL; while(as) { @@ -144,7 +144,7 @@ int ast_autoservice_stop(struct ast_channel *chan) } if (asthread != -1) pthread_kill(asthread, SIGURG); - ast_pthread_mutex_unlock(&autolock); + ast_mutex_unlock(&autolock); /* Wait for it to un-block */ while(chan->blocking) usleep(1000); |