mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-01-15 22:01:01 +01:00
MINOR: tinfo: replace the tgid with tgid_bit in tgroup_info
Now that the tgid is accessible from the thread, it's pointless to have it in the group, and it was only set but never used. However we'll soon frequently need the mask corresponding to the group ID and the risk of getting it wrong with the +1 or to shift 1 instead of 1UL is important, so let's store the tgid_bit there.
This commit is contained in:
parent
66ad98a772
commit
60fe4a95a2
@ -54,7 +54,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) */
|
||||
ulong tgid_bit; /* bit corresponding to the tgroup ID */
|
||||
|
||||
/* pad to cache line (64B) */
|
||||
char __pad[0]; /* unused except to check remaining room */
|
||||
|
||||
@ -1019,7 +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;
|
||||
ha_tgroup_info[g].tgid_bit = 1UL << g;
|
||||
}
|
||||
|
||||
if (ug > ut) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user