ntp: delay initial transmission until first resolving ends

This will be needed to prevent loading of dump files after sources have
already accumulated samples and possibly reference was already updated
when async resolving of sources is implemented.
This commit is contained in:
Miroslav Lichvar
2014-04-29 11:16:16 +02:00
parent be3439fef1
commit 779e40ed66
5 changed files with 92 additions and 41 deletions

3
main.c
View File

@@ -147,6 +147,8 @@ post_init_ntp_hook(void *anything)
RTC_StartMeasurements();
RCL_StartRefclocks();
NSR_StartSources();
NSR_AutoStartSources();
/* Special modes can end only when sources update their reachability.
Give up immediatelly if there are no active sources. */
@@ -184,6 +186,7 @@ post_init_rtc_hook(void *anything)
{
if (CNF_GetInitSources() > 0) {
CNF_AddInitSources();
NSR_StartSources();
assert(REF_GetMode() != REF_ModeNormal);
/* Wait for mode end notification */
} else {