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 /res/res_parking.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 'res/res_parking.c')
-rwxr-xr-x | res/res_parking.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/res/res_parking.c b/res/res_parking.c index 821dcee79..828be881b 100755 --- a/res/res_parking.c +++ b/res/res_parking.c @@ -83,7 +83,7 @@ struct parkeduser { static struct parkeduser *parkinglot; -static pthread_mutex_t parking_lock = AST_MUTEX_INITIALIZER; +static ast_mutex_t parking_lock = AST_MUTEX_INITIALIZER; static pthread_t parking_thread; @@ -109,7 +109,7 @@ int ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeou int x; pu = malloc(sizeof(struct parkeduser)); if (pu) { - ast_pthread_mutex_lock(&parking_lock); + ast_mutex_lock(&parking_lock); for (x=parking_start;x<=parking_stop;x++) { cur = parkinglot; while(cur) { @@ -151,7 +151,7 @@ int ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeou pu->priority = chan->priority; pu->next = parkinglot; parkinglot = pu; - ast_pthread_mutex_unlock(&parking_lock); + ast_mutex_unlock(&parking_lock); /* Wake up the (presumably select()ing) thread */ pthread_kill(parking_thread, SIGURG); if (option_verbose > 1) @@ -162,7 +162,7 @@ int ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeou } else { ast_log(LOG_WARNING, "No more parking spaces\n"); free(pu); - ast_pthread_mutex_unlock(&parking_lock); + ast_mutex_unlock(&parking_lock); return -1; } } else { @@ -412,7 +412,7 @@ static void *do_parking_thread(void *ignore) for (;;) { ms = -1; max = -1; - ast_pthread_mutex_lock(&parking_lock); + ast_mutex_lock(&parking_lock); pl = NULL; pu = parkinglot; gettimeofday(&tv, NULL); @@ -488,7 +488,7 @@ std: for (x=0;x<AST_MAX_FDS;x++) { } } } - ast_pthread_mutex_unlock(&parking_lock); + ast_mutex_unlock(&parking_lock); rfds = nrfds; efds = nefds; tv.tv_sec = ms / 1000; @@ -514,7 +514,7 @@ static int park_exec(struct ast_channel *chan, void *data) } LOCAL_USER_ADD(u); park = atoi((char *)data); - ast_pthread_mutex_lock(&parking_lock); + ast_mutex_lock(&parking_lock); pu = parkinglot; while(pu) { if (pu->parkingnum == park) { @@ -527,7 +527,7 @@ static int park_exec(struct ast_channel *chan, void *data) pl = pu; pu = pu->next; } - ast_pthread_mutex_unlock(&parking_lock); + ast_mutex_unlock(&parking_lock); if (pu) { peer = pu->chan; free(pu); @@ -578,7 +578,7 @@ static int handle_parkedcalls(int fd, int argc, char *argv[]) ast_cli(fd, "%4s %25s (%-15s %-12s %-4s) %-6s \n", "Num", "Channel" , "Context", "Extension", "Pri", "Timeout"); - ast_pthread_mutex_lock(&parking_lock); + ast_mutex_lock(&parking_lock); cur=parkinglot; while(cur) { @@ -589,7 +589,7 @@ static int handle_parkedcalls(int fd, int argc, char *argv[]) cur = cur->next; } - ast_pthread_mutex_unlock(&parking_lock); + ast_mutex_unlock(&parking_lock); return RESULT_SUCCESS; } |