diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-10-28 16:35:43 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-10-28 16:35:43 +0000 |
commit | f67cec6dcc4690953dd6264a9f12e0e800515be5 (patch) | |
tree | e51ddf6b780770743b0e41c98cba3f8f954fb129 /cdr.c | |
parent | 9f4683f23ff3818216e0d930d07d632f4a5f759b (diff) |
add 'ast_cond_t' type for pthread condition variables, and appropriate API wrappers
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6877 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'cdr.c')
-rwxr-xr-x | cdr.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -91,7 +91,7 @@ AST_MUTEX_DEFINE_STATIC(cdr_batch_lock); /* these are used to wake up the CDR thread when there's work to do */ AST_MUTEX_DEFINE_STATIC(cdr_pending_lock); -static pthread_cond_t cdr_pending_cond; +static ast_cond_t cdr_pending_cond; /* * We do a lot of checking here in the CDR code to try to be sure we don't ever let a CDR slip @@ -956,7 +956,7 @@ static void submit_unscheduled_batch(void) cdr_sched = ast_sched_add(sched, 1, submit_scheduled_batch, NULL); /* signal the do_cdr thread to wakeup early and do some work (that lazy thread ;) */ ast_mutex_lock(&cdr_pending_lock); - pthread_cond_signal(&cdr_pending_cond); + ast_cond_signal(&cdr_pending_cond); ast_mutex_unlock(&cdr_pending_lock); } @@ -1032,7 +1032,7 @@ static void *do_cdr(void *data) timeout.tv_nsec = (now.tv_usec * 1000) + ((schedms % 1000) * 1000); /* prevent stuff from clobbering cdr_pending_cond, then wait on signals sent to it until the timeout expires */ ast_mutex_lock(&cdr_pending_lock); - ast_pthread_cond_timedwait(&cdr_pending_cond, &cdr_pending_lock, &timeout); + ast_cond_timedwait(&cdr_pending_cond, &cdr_pending_lock, &timeout); numevents = ast_sched_runq(sched); ast_mutex_unlock(&cdr_pending_lock); if (option_debug > 1) @@ -1179,7 +1179,7 @@ static int do_reload(void) /* if this reload enabled the CDR batch mode, create the background thread if it does not exist */ if (enabled && batchmode && (!was_enabled || !was_batchmode) && (cdr_thread == AST_PTHREADT_NULL)) { - pthread_cond_init(&cdr_pending_cond, NULL); + ast_cond_init(&cdr_pending_cond, NULL); pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); if (ast_pthread_create(&cdr_thread, &attr, do_cdr, NULL) < 0) { @@ -1198,7 +1198,7 @@ static int do_reload(void) pthread_kill(cdr_thread, SIGURG); pthread_join(cdr_thread, NULL); cdr_thread = AST_PTHREADT_NULL; - pthread_cond_destroy(&cdr_pending_cond); + ast_cond_destroy(&cdr_pending_cond); ast_cli_unregister(&cli_submit); ast_unregister_atexit(ast_cdr_engine_term); res = 0; |