mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-18 00:26:57 +02:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user