MAJOR: task: use t->tid instead of ffsl(t->thread_mask) to take the thread ID

At several places we need to figure the ID of the first thread allowed
to run a task. Till now this was performed using my_ffsl(t->thread_mask)
but since we now have the thread ID stored into the task, let's use it
instead. This is tagged major because it starts to assume that tid<0 is
strictly equivalent to atleast2(thread_mask), and that as such, among
the allowed threads are the current one.
This commit is contained in:
Willy Tarreau
2022-06-15 14:31:38 +02:00
parent 5b8e054732
commit 29ffe26733
3 changed files with 10 additions and 7 deletions

View File

@@ -438,9 +438,12 @@ static inline void _tasklet_wakeup_on(struct tasklet *tl, int thr, const char *f
static inline void _task_instant_wakeup(struct task *t, unsigned int f, const char *file, int line)
{
struct tasklet *tl = (struct tasklet *)t;
int thr = my_ffsl(t->thread_mask) - 1;
int thr = t->tid;
unsigned int state;
if (thr < 0)
thr = tid;
/* first, let's update the task's state with the wakeup condition */
state = _HA_ATOMIC_OR_FETCH(&tl->state, f);