MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / findWithFallback

Method findWithFallback

Tactility/Source/hal/gps/Satellites.cpp:82–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82SatelliteStorage::SatelliteRecord* SatelliteStorage::findWithFallback(int number) {
83 auto lock = mutex.asScopedLock();
84 lock.lock();
85
86 if (auto* found_record = findRecord(number)) {
87 return found_record;
88 } else if (auto* unused_record = findUnusedRecord()) {
89 return unused_record;
90 } else {
91 return findRecordToRecycle();
92 }
93}
94
95void SatelliteStorage::notify(const minmea_sat_info& data) {
96 auto lock = mutex.asScopedLock();

Callers

nothing calls this directly

Calls 2

asScopedLockMethod · 0.80
lockMethod · 0.45

Tested by

no test coverage detected