aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Database.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Database.cpp b/src/Database.cpp
index 383cc18..d4ae190 100644
--- a/src/Database.cpp
+++ b/src/Database.cpp
@@ -132,11 +132,6 @@ namespace odhtdb
if(ntpThread->joinable())
ntpThread->detach();
}
-
- while(!timestampSynced)
- {
- this_thread::sleep_for(10ms);
- }
}
Database::~Database()
@@ -438,7 +433,10 @@ namespace odhtdb
ntp::NtpTimestamp Database::getSyncedTimestampUtc() const
{
- assert(timestampSynced);
+ while(!timestampSynced)
+ {
+ this_thread::sleep_for(10ms);
+ }
ntp::NtpTimestamp timestamp;
timestamp.seconds = time(nullptr) - timeOffset;
timestamp.fractions = 0; // TODO: Set this