trace2: improve thread-name documentation in the thread-context

Improve the documentation of the tr2tls_thread_ctx.thread_name field and its relation to the tr2tls_thread_ctx.thread_id field. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff Hostetler committed Oct 24, 2022 at 13:41 UTC 31247936041318d441de5a2681f9bcb79459c726
1 file changed +9 -6
trace2/tr2_tls.h
+9 -6
@@ -25,12 +25,15 @@ struct tr2tls_thread_ctx {
25 /*
26 * Create thread-local storage for the current thread.
27 *
28 - * We assume the first thread is "main". Other threads are given
29 - * non-zero thread-ids to help distinguish messages from concurrent
30 - * threads.
31 - *
32 - * Truncate the thread name if necessary to help with column alignment
33 - * in printf-style messages.
28 + * The first thread in the process will have:
29 + * { .thread_id=0, .thread_name="main" }
30 + * Subsequent threads are given a non-zero thread_id and a thread_name
31 + * constructed from the id and a thread base name (which is usually just
32 + * the name of the thread-proc function). For example:
33 + * { .thread_id=10, .thread_name="th10:fsm-listen" }
34 + * This helps to identify and distinguish messages from concurrent threads.
35 + * The ctx.thread_name field is truncated if necessary to help with column
36 + * alignment in printf-style messages.
37 *
38 * In this and all following functions the term "self" refers to the
39 * current thread.