jlaitine commented on code in PR #8026:
URL: https://github.com/apache/nuttx/pull/8026#discussion_r1063428645


##########
include/nuttx/mm/map.h:
##########
@@ -73,11 +73,156 @@ struct mm_map_entry_s
 struct mm_map_s
 {
   sq_queue_t mm_map_sq;
-  mutex_t mm_map_mutex;
+  rmutex_t mm_map_mutex;
 };
 
 /****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
 
-#endif /* __INCLUDE_NUTTX_MM_MM_MAP_H */
+/****************************************************************************
+ * Name: mm_map_lock
+ *
+ * Description:
+ *   Get exclusive access to task_group's mm_map
+ *
+ * Input Parameters:
+ *   mm - Pointer to the mm_map_s
+ *
+ * Returned Value:
+ *   OK on success
+ *   A negated errno value on failure
+ *
+ ****************************************************************************/
+
+int mm_map_lock(FAR struct task_group_s *group);

Review Comment:
   Removed "group" argument. You always lock your own, the currently running 
memory maps



##########
include/nuttx/mm/map.h:
##########
@@ -73,11 +73,156 @@ struct mm_map_entry_s
 struct mm_map_s
 {
   sq_queue_t mm_map_sq;
-  mutex_t mm_map_mutex;
+  rmutex_t mm_map_mutex;
 };
 
 /****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
 
-#endif /* __INCLUDE_NUTTX_MM_MM_MAP_H */
+/****************************************************************************
+ * Name: mm_map_lock
+ *
+ * Description:
+ *   Get exclusive access to task_group's mm_map
+ *
+ * Input Parameters:
+ *   mm - Pointer to the mm_map_s
+ *
+ * Returned Value:
+ *   OK on success
+ *   A negated errno value on failure
+ *
+ ****************************************************************************/
+
+int mm_map_lock(FAR struct task_group_s *group);
+
+/****************************************************************************
+ * Name: mm_map_unlock
+ *
+ * Description:
+ *   Relinquish exclusive access to task_group's mm_map
+ *
+ * Input Parameters:
+ *   mm - Pointer to the mm_map_s
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+void mm_map_unlock(FAR struct task_group_s *group);

Review Comment:
   Removed "group" argument. You always lock your own, the currently running 
memory maps



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to