diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-10-13 15:53:22 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-10-13 15:53:22 +0000 |
commit | 7faa9ad942e9858ffa83d9646332dbbcbd10baf9 (patch) | |
tree | 920c6be05e21a9118faec280959e13d1cb392636 /main | |
parent | ce6f87a2bc4d37bab51811f786fb907b8d8e6a0a (diff) |
Merged revisions 45030 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r45030 | file | 2006-10-13 11:49:53 -0400 (Fri, 13 Oct 2006) | 2 lines
Pass the right value to usleep for sleeping, and always add the background refresh item back into the scheduler if enabled since it is deleted during reload. (issue #8142 reported by p_lindheimer)
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@45031 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/dnsmgr.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/main/dnsmgr.c b/main/dnsmgr.c index 3f370e054..e7ce3190d 100644 --- a/main/dnsmgr.c +++ b/main/dnsmgr.c @@ -212,7 +212,7 @@ static void *do_refresh(void *data) { for (;;) { pthread_testcancel(); - usleep(ast_sched_wait(sched)); + usleep((ast_sched_wait(sched)*1000)); pthread_testcancel(); ast_sched_runq(sched); } @@ -389,16 +389,16 @@ static int do_reload(int loading) /* if this reload enabled the manager, create the background thread if it does not exist */ - if (enabled && !was_enabled && (refresh_thread == AST_PTHREADT_NULL)) { - if (ast_pthread_create_background(&refresh_thread, NULL, do_refresh, NULL) < 0) { - ast_log(LOG_ERROR, "Unable to start refresh thread.\n"); - } - else { + if (enabled) { + if (!was_enabled && (refresh_thread == AST_PTHREADT_NULL)) { + if (ast_pthread_create_background(&refresh_thread, NULL, do_refresh, NULL) < 0) { + ast_log(LOG_ERROR, "Unable to start refresh thread.\n"); + } ast_cli_register(&cli_refresh); - /* make a background refresh happen right away */ - refresh_sched = ast_sched_add_variable(sched, 100, refresh_list, &master_refresh_info, 1); - res = 0; } + /* make a background refresh happen right away */ + refresh_sched = ast_sched_add_variable(sched, 100, refresh_list, &master_refresh_info, 1); + res = 0; } /* if this reload disabled the manager and there is a background thread, kill it */ |