geofence: lock geofence items during a write transfers

- avoids race conditions when geofence data is updated in flight. During
  a transfer, the geofence module will not check for violations, which
  is done with the new dm_trylock method.
- there is an update counter stored in dataman, and for each write
  transaction this is increased, so that the geofence module can reload
  the data upon data change (after it's unlocked).
- single dm item updates are atomic already, so resetting the polygons
  to 0 does not need locking.
This commit is contained in:
Beat Küng
2017-08-04 18:08:51 +02:00
committed by Lorenz Meier
parent cb580c5268
commit 6d85a3c4e4
5 changed files with 100 additions and 10 deletions
+1
View File
@@ -153,6 +153,7 @@ struct mission_item_s {
*/
struct mission_stats_entry_s {
uint16_t num_items; /**< total number of items stored (excluding this one) */
uint16_t update_counter; /**< This counter is increased when (some) items change (this can wrap) */
};
/**