[asterisk-commits] juggie: branch juggie/NoLossCDR r83516 - in /team/juggie/NoLossCDR: cdr/ main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Sep 21 15:12:32 CDT 2007
Author: juggie
Date: Fri Sep 21 15:12:31 2007
New Revision: 83516
URL: http://svn.digium.com/view/asterisk?view=rev&rev=83516
Log:
some debug code to help figure out some locking issues
Modified:
team/juggie/NoLossCDR/cdr/cdr_custom.c
team/juggie/NoLossCDR/main/cdr.c
Modified: team/juggie/NoLossCDR/cdr/cdr_custom.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/cdr/cdr_custom.c?view=diff&rev=83516&r1=83515&r2=83516
==============================================================================
--- team/juggie/NoLossCDR/cdr/cdr_custom.c (original)
+++ team/juggie/NoLossCDR/cdr/cdr_custom.c Fri Sep 21 15:12:31 2007
@@ -154,7 +154,7 @@
/* Abort if no master file is specified */
if (ast_strlen_zero(sink->filename))
- return AST_CDR_POST_FATAL;
+ return AST_CDR_POST_DISABLED;
memset(buf, 0 , DEFAULT_BUFFER_SIZE);
/* Quite possibly the first use of a static struct ast_channel, we need it so the var funcs will work */
Modified: team/juggie/NoLossCDR/main/cdr.c
URL: http://svn.digium.com/view/asterisk/team/juggie/NoLossCDR/main/cdr.c?view=diff&rev=83516&r1=83515&r2=83516
==============================================================================
--- team/juggie/NoLossCDR/main/cdr.c (original)
+++ team/juggie/NoLossCDR/main/cdr.c Fri Sep 21 15:12:31 2007
@@ -810,13 +810,16 @@
ast_debug(1, "CDR Worker thread for %s started\n", i->name);
for (;;) {
+ ast_debug(1, "CDR Worker thread for %s: top of loop\n", i->name);
/* We lock the cdr queue and see if one exists
if not we wait to be signaled*/
AST_LIST_LOCK(&i->cdr_queue);
+ ast_debug(1, "CDR Worker thread for %s: got the list lock\n", i->name);
if (AST_LIST_EMPTY(&i->cdr_queue) && !i->cancel_thread) {
ast_debug(1, "I guess the cdr queue for %s is empty, lets wait\n", i->name);
ast_cond_wait(&i->cdr_pending_cond, &i->cdr_queue.lock);
} else if (AST_LIST_EMPTY(&i->cdr_queue) && i->cancel_thread){
+ AST_LIST_UNLOCK(&i->cdr_queue);
break;
}
next = AST_LIST_FIRST(&i->cdr_queue);
@@ -993,11 +996,17 @@
ast_cond_signal(&i->cdr_pending_cond);
ast_cond_signal(&i->cdr_retry_cond);
/* wait for thread to exit so we can clean up */
+ ast_verbose(VERBOSE_PREFIX_2 "joining thread\n");
pthread_join(i->cdr_thread, NULL);
+ ast_verbose(VERBOSE_PREFIX_2 "=ast\n");
i->cdr_thread = AST_PTHREADT_NULL;
+ ast_verbose(VERBOSE_PREFIX_2 "destroy 1\n");
ast_cond_destroy(&i->cdr_pending_cond);
+ ast_verbose(VERBOSE_PREFIX_2 "destroy 2\n");
ast_cond_destroy(&i->cdr_retry_cond);
+ ast_verbose(VERBOSE_PREFIX_2 "remove\n");
AST_RWLIST_REMOVE_CURRENT(&be_list, list);
+ ast_verbose(VERBOSE_PREFIX_2 "ast_free\n");
ast_free(i);
}
AST_RWLIST_TRAVERSE_SAFE_END;
More information about the asterisk-commits
mailing list