mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-10-27 06:31:23 +01:00
MINOR: sched: pass the thread number to is_sched_alive()
Now it will be possible to query any thread's scheduler state, not only the current one. This aims at simplifying the watchdog checks for reported threads. The operation is now a simple atomic xchg.
This commit is contained in:
parent
7c7e17a605
commit
25f5f357cc
@ -123,11 +123,11 @@ void wake_expired_tasks(void);
|
||||
*/
|
||||
int next_timer_expiry(void);
|
||||
|
||||
/* Pings the scheduler to verify that tasks continue running.
|
||||
* Returns 1 if the scheduler made progress since last call,
|
||||
* 0 if it looks stuck.
|
||||
/* Pings the scheduler to verify that tasks continue running for thread <thr>.
|
||||
* Returns 1 if the scheduler made progress since last call, 0 if it looks
|
||||
* stuck. It marks it as stuck for next visit.
|
||||
*/
|
||||
int is_sched_alive(void);
|
||||
int is_sched_alive(int thr);
|
||||
|
||||
/*
|
||||
* Delete every tasks before running the master polling loop
|
||||
|
||||
15
src/task.c
15
src/task.c
@ -910,18 +910,13 @@ void process_runnable_tasks()
|
||||
activity[tid].long_rq++;
|
||||
}
|
||||
|
||||
/* Pings the scheduler to verify that tasks continue running.
|
||||
* Returns 1 if the scheduler made progress since last call,
|
||||
* 0 if it looks stuck.
|
||||
/* Pings the scheduler to verify that tasks continue running for thread <thr>.
|
||||
* Returns 1 if the scheduler made progress since last call, 0 if it looks
|
||||
* stuck. It marks it as stuck for next visit.
|
||||
*/
|
||||
int is_sched_alive(void)
|
||||
int is_sched_alive(int thr)
|
||||
{
|
||||
if (sched_ctx[tid].sched_stuck)
|
||||
return 0;
|
||||
|
||||
/* next time we'll know if any progress was made */
|
||||
sched_ctx[tid].sched_stuck = 1;
|
||||
return 1;
|
||||
return !HA_ATOMIC_XCHG(&sched_ctx[thr].sched_stuck, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user