diff options
author | Mark Spencer <markster@digium.com> | 2003-08-13 15:25:16 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2003-08-13 15:25:16 +0000 |
commit | 1bb58646de07501c96c53a963820ef70f73d50c5 (patch) | |
tree | 3f2cc11c392b1496cf6518e8b6eb99e8b04417a1 /asterisk.c | |
parent | 4a396046fec3026140078479ff73fe3a98728bee (diff) |
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
Diffstat (limited to 'asterisk.c')
-rwxr-xr-x | asterisk.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/asterisk.c b/asterisk.c index ccc384574..8813c0722 100755 --- a/asterisk.c +++ b/asterisk.c @@ -75,7 +75,7 @@ static struct ast_atexit { void (*func)(void); struct ast_atexit *next; } *atexits = NULL; -static pthread_mutex_t atexitslock = AST_MUTEX_INITIALIZER; +static ast_mutex_t atexitslock = AST_MUTEX_INITIALIZER; time_t ast_startuptime; time_t ast_lastreloadtime; @@ -111,7 +111,7 @@ int ast_register_atexit(void (*func)(void)) struct ast_atexit *ae; ast_unregister_atexit(func); ae = malloc(sizeof(struct ast_atexit)); - ast_pthread_mutex_lock(&atexitslock); + ast_mutex_lock(&atexitslock); if (ae) { memset(ae, 0, sizeof(struct ast_atexit)); ae->next = atexits; @@ -119,14 +119,14 @@ int ast_register_atexit(void (*func)(void)) atexits = ae; res = 0; } - ast_pthread_mutex_unlock(&atexitslock); + ast_mutex_unlock(&atexitslock); return res; } void ast_unregister_atexit(void (*func)(void)) { struct ast_atexit *ae, *prev = NULL; - ast_pthread_mutex_lock(&atexitslock); + ast_mutex_lock(&atexitslock); ae = atexits; while(ae) { if (ae->func == func) { @@ -139,7 +139,7 @@ void ast_unregister_atexit(void (*func)(void)) prev = ae; ae = ae->next; } - ast_pthread_mutex_unlock(&atexitslock); + ast_mutex_unlock(&atexitslock); } static int fdprint(int fd, const char *s) @@ -402,14 +402,14 @@ static int shuttingdown = 0; static void ast_run_atexits(void) { struct ast_atexit *ae; - ast_pthread_mutex_lock(&atexitslock); + ast_mutex_lock(&atexitslock); ae = atexits; while(ae) { if (ae->func) ae->func(); ae = ae->next; } - ast_pthread_mutex_unlock(&atexitslock); + ast_mutex_unlock(&atexitslock); } static void quit_handler(int num, int nice, int safeshutdown, int restart) |