From 09f5cad73062ae8b2b107fc6fb5637147dcfeebd Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Thu, 1 Aug 2019 16:10:08 +0100
Subject: [PATCH] SrtSystemInfo: Document (lack of) thread-safety

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 steam-runtime-tools/system-info.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/steam-runtime-tools/system-info.c b/steam-runtime-tools/system-info.c
index 4a6ae3f06..55e5d9f93 100644
--- a/steam-runtime-tools/system-info.c
+++ b/steam-runtime-tools/system-info.c
@@ -48,6 +48,17 @@
  *
  * This is a reference-counted object: use g_object_ref() and
  * g_object_unref() to manage its lifecycle.
+ *
+ * The #SrtSystemInfo object is not thread-aware. It should be considered
+ * to be "owned" by the thread that created it. Only the thread that
+ * "owns" the #SrtSystemInfo may call its methods.
+ * Other threads may create their own parallel #SrtSystemInfo object and
+ * use that instead, if desired.
+ *
+ * Ownership can be transferred to other threads by an operation that
+ * implies a memory barrier, such as g_atomic_pointer_set() or
+ * g_object_ref(), but after this is done the previous owner must not
+ * continue to call methods.
  */
 
 typedef enum
-- 
GitLab