]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: threads: set the group ID and its bit in the thread group
authorWilly Tarreau <w@1wt.eu>
Tue, 28 Sep 2021 06:50:02 +0000 (08:50 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 8 Oct 2021 15:22:26 +0000 (17:22 +0200)
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.

include/haproxy/tinfo-t.h
src/thread.c

index e2779ab1097af3a32686ab12a1de7ea81812815e..ba24249755219409d2619205d5abaaa5cdb16bda 100644 (file)
@@ -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 */
index 2a7d3aff3d6126a05cbbd1f3699a14a53833b599..0b979f91208286ab4a8ff788b8b3f7e76f2e03fe 100644 (file)
@@ -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) {