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 /cdr.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 'cdr.c')
-rwxr-xr-x | cdr.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -27,7 +27,7 @@ int ast_default_amaflags = AST_CDR_DOCUMENTATION; char ast_default_accountcode[20] = ""; -static pthread_mutex_t cdrlock = AST_MUTEX_INITIALIZER; +static ast_mutex_t cdrlock = AST_MUTEX_INITIALIZER; static struct ast_cdr_beitem { char name[20]; @@ -52,14 +52,14 @@ int ast_cdr_register(char *name, char *desc, ast_cdrbe be) ast_log(LOG_WARNING, "CDR engine '%s' lacks backend\n", name); return -1; } - ast_pthread_mutex_lock(&cdrlock); + ast_mutex_lock(&cdrlock); i = bes; while(i) { if (!strcasecmp(name, i->name)) break; i = i->next; } - ast_pthread_mutex_unlock(&cdrlock); + ast_mutex_unlock(&cdrlock); if (i) { ast_log(LOG_WARNING, "Already have a CDR backend called '%s'\n", name); return -1; @@ -71,17 +71,17 @@ int ast_cdr_register(char *name, char *desc, ast_cdrbe be) strncpy(i->name, name, sizeof(i->name) - 1); strncpy(i->desc, desc, sizeof(i->desc) - 1); i->be = be; - ast_pthread_mutex_lock(&cdrlock); + ast_mutex_lock(&cdrlock); i->next = bes; bes = i; - ast_pthread_mutex_unlock(&cdrlock); + ast_mutex_unlock(&cdrlock); return 0; } void ast_cdr_unregister(char *name) { struct ast_cdr_beitem *i, *prev = NULL; - ast_pthread_mutex_lock(&cdrlock); + ast_mutex_lock(&cdrlock); i = bes; while(i) { if (!strcasecmp(name, i->name)) { @@ -93,7 +93,7 @@ void ast_cdr_unregister(char *name) } i = i->next; } - ast_pthread_mutex_unlock(&cdrlock); + ast_mutex_unlock(&cdrlock); if (i) free(i); } @@ -367,13 +367,13 @@ void ast_cdr_post(struct ast_cdr *cdr) } else cdr->billsec = 0; cdr->posted = 1; - ast_pthread_mutex_lock(&cdrlock); + ast_mutex_lock(&cdrlock); i = bes; while(i) { i->be(cdr); i = i->next; } - ast_pthread_mutex_unlock(&cdrlock); + ast_mutex_unlock(&cdrlock); } } |