From cf5df4489f61966cb9ce69ec91a5a7acadfcd1cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Thu, 18 May 2017 16:27:27 +0200 Subject: [PATCH] dataman: extend module documentation --- src/modules/dataman/dataman.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/modules/dataman/dataman.cpp b/src/modules/dataman/dataman.cpp index b3dcdf27b4..daa4d83ac9 100644 --- a/src/modules/dataman/dataman.cpp +++ b/src/modules/dataman/dataman.cpp @@ -1470,6 +1470,15 @@ Multiple backends are supported: It is used to store structured data of different types: mission waypoints, mission state and geofence polygons. Each type has a specific type and a fixed maximum amount of storage items, so that fast random access is possible. +### Implementation +Reading and writing a single item is always atomic. If multiple items need to be read/modified atomically, there is +an additional lock per item type via `dm_lock`. + +**DM_KEY_FENCE_POINTS** and **DM_KEY_SAFE_POINTS** items: the first data element is a `mission_stats_entry_s` struct, +which stores the number of items for these types. These items are always updated atomically in one transaction (from +the mavlink mission manager). During that time, navigator will try to acquire the geofence item lock, fail, and will not +check for geofence violations. + )DESCR_STR"); PRINT_MODULE_USAGE_NAME("dataman", "system");