[master] 0dd8b32bc Use PTHREAD_NULL if the platform has it.

Poul-Henning Kamp phk at FreeBSD.org
Mon Feb 22 13:33:06 UTC 2021


commit 0dd8b32bc23d14c42ea105cde4ec30a0a0c72a7e
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Feb 22 13:31:47 2021 +0000

    Use PTHREAD_NULL if the platform has it.
    
    Spotted by: Rasmus Villemoes

diff --git a/bin/varnishd/cache/cache_lck.c b/bin/varnishd/cache/cache_lck.c
index 16c266291..c3c726708 100644
--- a/bin/varnishd/cache/cache_lck.c
+++ b/bin/varnishd/cache/cache_lck.c
@@ -154,7 +154,11 @@ Lck__Unlock(struct lock *lck, const char *p, int l)
 	 * implementations of pthread.
 	 * #endif
 	 */
+#ifdef PTHREAD_NULL
+	ilck->owner = PTHREAD_NULL;
+#else
 	memset(&ilck->owner, 0, sizeof ilck->owner);
+#endif
 	AZ(pthread_mutex_unlock(&ilck->mtx));
 	if (DO_DEBUG(DBG_WITNESS))
 		Lck_Witness_Unlock(ilck);


More information about the varnish-commit mailing list