Message ID | 20240923155343.43720-1-jwyatt@redhat.com |
---|---|
State | New |
Headers | show |
Series | rt-tests: pi_stress: Move unlock into if block with matching lock | expand |
On Mon, 23 Sep 2024, John B. Wyatt IV wrote: > Resolve unlocking a not locked mutex. > > Issue reported by Valgrind's Helgrind tool. > > Signed-off-by: John B. Wyatt IV <jwyatt@redhat.com> > Signed-off-by: John B. Wyatt IV <sageofredondo@gmail.com> > --- > src/pi_tests/pi_stress.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c > index 673a7bb..371e906 100644 > --- a/src/pi_tests/pi_stress.c > +++ b/src/pi_tests/pi_stress.c > @@ -552,8 +552,8 @@ void *reporter(void *arg __attribute__ ((unused))) > printf("Current Inversions: %lu\n", > total_inversions()); > } > + pthread_mutex_unlock(&shutdown_mtx); > } > - pthread_mutex_unlock(&shutdown_mtx); > > /* if we specified a duration, see if it has expired */ > if (end && time(NULL) > end) { > -- > 2.46.0 > > > Signed-off-by: John Kacur <jkacur@redhat.com>
diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c index 673a7bb..371e906 100644 --- a/src/pi_tests/pi_stress.c +++ b/src/pi_tests/pi_stress.c @@ -552,8 +552,8 @@ void *reporter(void *arg __attribute__ ((unused))) printf("Current Inversions: %lu\n", total_inversions()); } + pthread_mutex_unlock(&shutdown_mtx); } - pthread_mutex_unlock(&shutdown_mtx); /* if we specified a duration, see if it has expired */ if (end && time(NULL) > end) {