From: Willy Tarreau Date: Tue, 28 Sep 2021 06:50:02 +0000 (+0200) Subject: MINOR: threads: set the group ID and its bit in the thread group X-Git-Tag: v2.5-dev9~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6eee85f887aaaae32f714db59b119aab903463be;p=thirdparty%2Fhaproxy.git MINOR: threads: set the group ID and its bit in the thread group This will ease the reporting of the current thread group ID when coming from the thread itself, especially since it returns the visible ID, starting at 1. --- diff --git a/include/haproxy/tinfo-t.h b/include/haproxy/tinfo-t.h index e2779ab109..ba24249755 100644 --- a/include/haproxy/tinfo-t.h +++ b/include/haproxy/tinfo-t.h @@ -46,6 +46,7 @@ enum { struct tgroup_info { uint base; /* first thread in this group */ uint count; /* number of threads in this group */ + uint tgid; /* group ID (starts at 1, 0=unspecified) */ /* pad to cache line (64B) */ char __pad[0]; /* unused except to check remaining room */ diff --git a/src/thread.c b/src/thread.c index 2a7d3aff3d..0b979f9120 100644 --- a/src/thread.c +++ b/src/thread.c @@ -1019,6 +1019,7 @@ int thread_map_to_groups() for (g = 0; g < global.nbtgroups; g++) { if (!ha_tgroup_info[g].count) ug++; + ha_tgroup_info[g].tgid = g + 1; } if (ug > ut) {