From: Punit Agrawal <punit1.agrawal@xxxxxxxxxxxxx> In timerthread(), "stopped" is used to track when the tracelimit has been breached. It prevents additional updates of break_thread_id. But the timerthread functionality is already guarded by "shutdown" which is also updated then latency crosses tracelimit. Remove the redundant variable "stopped" to simplify the logic. Signed-off-by: Punit Agrawal <punit1.agrawal@xxxxxxxxxxxxx> --- src/cyclictest/cyclictest.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c index d06ed01c58f4..721d242a1da0 100644 --- a/src/cyclictest/cyclictest.c +++ b/src/cyclictest/cyclictest.c @@ -511,7 +511,6 @@ static void *timerthread(void *param) struct itimerval itimer; struct itimerspec tspec; struct thread_stat *stat = par->stats; - int stopped = 0; cpu_set_t mask; pthread_t thread; unsigned long smi_now, smi_old = 0; @@ -715,8 +714,7 @@ static void *timerthread(void *param) if (duration && (calcdiff(now, stop) >= 0)) shutdown++; - if (!stopped && tracelimit && (diff > tracelimit)) { - stopped++; + if (tracelimit && (diff > tracelimit)) { shutdown++; pthread_mutex_lock(&break_thread_id_lock); if (break_thread_id == 0) { -- 2.32.0