[PATCH] rt-tests: pi_stress: Move unlock into if block with matching lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Resolve unlocking a not locked mutex.

Issue reported by Valgrind's Helgrind tool.

Signed-off-by: John B. Wyatt IV <jwyatt@xxxxxxxxxx>
Signed-off-by: John B. Wyatt IV <sageofredondo@xxxxxxxxx>
---
 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





[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux