From c30a9cfd8df1150f6a2e89dde93781e334d4453d Mon Sep 17 00:00:00 2001
From: Brian Norris <banorris@uci.edu>
Date: Fri, 12 Oct 2012 11:05:12 -0700
Subject: [PATCH] thread_id_t: add comments

---
 include/modeltypes.h | 18 ++++++++++++++++++
 threads-model.h      | 10 ++++++++++
 2 files changed, 28 insertions(+)

diff --git a/include/modeltypes.h b/include/modeltypes.h
index 22221cb..34525d2 100644
--- a/include/modeltypes.h
+++ b/include/modeltypes.h
@@ -1,6 +1,24 @@
+/**
+ * @file modeltypes.h
+ * @brief Common typedefs for the model-checker
+ */
+
 #ifndef __MODELTYPES_H__
 #define __MODELTYPES_H__
 
+/**
+ * @brief Represents a unique ID for a Thread
+ *
+ * The space of unique IDs may need to become a non-compact
+ * or non-zero-indexed set of integers (or even some other
+ * type). So this typedef is used to help identify which is
+ * which, where a simple 'int' is meant to be a compact,
+ * zero-indexed set and a 'thread_id_t' may be another type
+ * entirely.
+ *
+ * @see id_to_int
+ * @see int_to_id
+ */
 typedef int thread_id_t;
 
 #define THREAD_ID_T_NONE	-1
diff --git a/threads-model.h b/threads-model.h
index 8b165d5..b99b279 100644
--- a/threads-model.h
+++ b/threads-model.h
@@ -151,11 +151,21 @@ static inline thread_id_t thrd_to_id(thrd_t t)
 	return t;
 }
 
+/**
+ * @brief Map a zero-based integer index to a unique thread ID
+ *
+ * This is the inverse of id_to_int
+ */
 static inline thread_id_t int_to_id(int i)
 {
 	return i;
 }
 
+/**
+ * @brief Map a unique thread ID to a zero-based integer index
+ *
+ * This is the inverse of int_to_id
+ */
 static inline int id_to_int(thread_id_t id)
 {
 	return id;
-- 
2.34.1