mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-01 02:23:45 +00:00
[tracks] Safe GpsTrackCollection requests during recording.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
fb62982000
commit
b7b87f5530
@@ -50,15 +50,20 @@ void GpsTrack::AddPoints(vector<location::GpsInfo> const & points)
|
||||
ScheduleTask();
|
||||
}
|
||||
|
||||
TrackStatistics GpsTrack::GetTrackStatistics() const
|
||||
/// @note These functions are called during recording, so should be synchronized with Collection writer thread.
|
||||
/// @{
|
||||
TrackStatistics GpsTrack::GetTrackStatistics()
|
||||
{
|
||||
lock_guard<mutex> lg(m_threadGuard);
|
||||
return m_collection ? m_collection->GetTrackStatistics() : TrackStatistics();
|
||||
}
|
||||
|
||||
ElevationInfo const & GpsTrack::GetElevationInfo() const
|
||||
ElevationInfo const & GpsTrack::GetElevationInfo()
|
||||
{
|
||||
lock_guard<mutex> lg(m_threadGuard);
|
||||
return m_collection->UpdateAndGetElevationInfo();
|
||||
}
|
||||
/// @}
|
||||
|
||||
void GpsTrack::Clear()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user