const struct tgroup_info *tg; /* config of the thread-group this thread belongs to */
uint tid, ltid; /* process-wide and group-wide thread ID (start at 0) */
ulong ltid_bit; /* bit masks for the tid/ltid */
+ uint tgid; /* ID of the thread group this thread belongs to (starts at 1; 0=unset) */
/* pad to cache line (64B) */
char __pad[0]; /* unused except to check remaining room */
MT_LIST_ISEMPTY(&ha_thread_ctx[thr].shared_tasklet_list)),
ha_thread_ctx[thr].tasks_in_list,
ha_thread_ctx[thr].rq_total,
- ha_thread_info[thr].tg->tgid, ha_thread_info[thr].ltid + 1,
+ ha_thread_info[thr].tgid, ha_thread_info[thr].ltid + 1,
stuck,
!!(th_ctx->flags & TH_FL_TASK_PROFILING));
}
ha_tgroup_info[g].count++;
+ ha_thread_info[t].tgid = g + 1;
ha_thread_info[t].tg = &ha_tgroup_info[g];
ut--;
imask &= all_threads_mask;
for (t = 0; t < global.nbthread; t++) {
if (imask & (1UL << t)) {
- if (ha_thread_info[t].tg->tgid != igid) {
+ if (ha_thread_info[t].tgid != igid) {
if (!igid)
- igid = ha_thread_info[t].tg->tgid;
+ igid = ha_thread_info[t].tgid;
else {
- memprintf(err, "'thread' directive spans multiple groups (at least %u and %u)", igid, ha_thread_info[t].tg->tgid);
+ memprintf(err, "'thread' directive spans multiple groups (at least %u and %u)", igid, ha_thread_info[t].tgid);
return -1;
}
}
for (tnum = ha_tgroup_info[tgroup-1].base;
tnum < ha_tgroup_info[tgroup-1].base + ha_tgroup_info[tgroup-1].count;
tnum++) {
- if (ha_thread_info[tnum-1].tg == &ha_tgroup_info[tgroup-1])
+ if (ha_thread_info[tnum-1].tg == &ha_tgroup_info[tgroup-1]) {
ha_thread_info[tnum-1].tg = NULL;
+ ha_thread_info[tnum-1].tgid = 0;
+ }
}
ha_tgroup_info[tgroup-1].count = ha_tgroup_info[tgroup-1].base = 0;
}
ha_tgroup_info[tgroup-1].base = tnum - 1;
}
+ ha_thread_info[tnum-1].tgid = tgroup;
ha_thread_info[tnum-1].tg = &ha_tgroup_info[tgroup-1];
tot++;
}