This flag will be usable by any application. It will be preserved across
wakeups so the application can use it to do various stuff. Some I/O
handlers will soon benefit from this.
(cherry picked from commit
6fa8bcdc785c29cd3a29c14d2038f38b5547eff0)
[wt: needed for upcoming fixes. task->state is 16-bit in 2.3 and before
so we've reused bit 15 which was still available there. Ctx adjusments
since no TASK_F_TASKLET here]
Signed-off-by: Willy Tarreau <w@1wt.eu>
TASK_WOKEN_IO|TASK_WOKEN_SIGNAL|TASK_WOKEN_MSG| \
TASK_WOKEN_RES)
+#define TASK_F_USR1 0x80000 /* preserved user flag 1, application-specific, def:0 */
+
enum {
TL_URGENT = 0, /* urgent tasklets (I/O callbacks) */
TL_NORMAL = 1, /* normal tasks */
budgets[queue]--;
t = (struct task *)LIST_ELEM(tl_queues[queue].n, struct tasklet *, list);
- state = t->state & (TASK_SHARED_WQ|TASK_SELF_WAKING|TASK_HEAVY|TASK_KILLED);
+ state = t->state & (TASK_SHARED_WQ|TASK_SELF_WAKING|TASK_HEAVY|TASK_KILLED|TASK_F_USR1);
if (state & TASK_HEAVY) {
/* This is a heavy task. We'll call no more than one
LIST_DEL_INIT(&((struct tasklet *)t)->list);
__ha_barrier_store();
- state = _HA_ATOMIC_XCHG(&t->state, state | TASK_RUNNING);
+ state = _HA_ATOMIC_XCHG(&t->state, state|TASK_RUNNING|TASK_F_USR1);
__ha_barrier_atomic_store();
/* OK then this is a regular task */