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.
This commit is contained in:
Willy Tarreau 2021-09-28 08:50:02 +02:00
parent e6806ebecc
commit 6eee85f887
2 changed files with 2 additions and 0 deletions

View 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 */

View 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) {