[6.0] 296814e74 Don't unlock the mutex unless we locked it.

Poul-Henning Kamp phk at FreeBSD.org
Thu Aug 16 08:52:26 UTC 2018


commit 296814e74b9862213a0f884b9366bbc2d12490e9
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Mar 28 15:21:09 2018 +0000

    Don't unlock the mutex unless we locked it.
    
    It is only during cleanup, so this *may* be an adequate bandaid.

diff --git a/bin/varnishtest/vtc_barrier.c b/bin/varnishtest/vtc_barrier.c
index f7f68af59..035e6b20a 100644
--- a/bin/varnishtest/vtc_barrier.c
+++ b/bin/varnishtest/vtc_barrier.c
@@ -422,7 +422,8 @@ cmd_barrier(CMD_ARGS)
 			default:
 				WRONG("Wrong barrier type");
 			}
-			AZ(pthread_mutex_unlock(&b->mtx));
+			if (r == 0)
+				AZ(pthread_mutex_unlock(&b->mtx));
 		}
 		return;
 	}


More information about the varnish-commit mailing list