aboutsummaryrefslogtreecommitdiffstats
path: root/asterisk.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-08-13 15:25:16 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-08-13 15:25:16 +0000
commitdbc9edcaac6ec1d2059f4c5bcd27cca6c266f5bf (patch)
tree3f2cc11c392b1496cf6518e8b6eb99e8b04417a1 /asterisk.c
parent231b9aad4020331a8c68d1a2826ee1ef930ec57b (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 'asterisk.c')
-rwxr-xr-xasterisk.c14
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)