[master] 1f490ae Remove the list of all mutexes, we have never used it for anything.
Poul-Henning Kamp
phk at FreeBSD.org
Wed Dec 16 23:37:51 CET 2015
commit 1f490ae77651e7391d4f6e04e27556a5d0a505b9
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Wed Dec 16 22:36:51 2015 +0000
Remove the list of all mutexes, we have never used it for anything.
diff --git a/bin/varnishd/cache/cache_lck.c b/bin/varnishd/cache/cache_lck.c
index c623ab7..f1cea24 100644
--- a/bin/varnishd/cache/cache_lck.c
+++ b/bin/varnishd/cache/cache_lck.c
@@ -41,25 +41,18 @@
#include "cache.h"
-/*The constability of lck depends on platform pthreads implementation */
-
struct ilck {
unsigned magic;
#define ILCK_MAGIC 0x7b86c8a5
- pthread_mutex_t mtx;
int held;
+ pthread_mutex_t mtx;
pthread_t owner;
- VTAILQ_ENTRY(ilck) list;
const char *w;
struct VSC_C_lck *stat;
};
static pthread_mutexattr_t attr;
-static VTAILQ_HEAD(, ilck) ilck_head = VTAILQ_HEAD_INITIALIZER(ilck_head);
-
-static pthread_mutex_t lck_mtx;
-
/*--------------------------------------------------------------------*/
static void
@@ -226,9 +219,6 @@ Lck__New(struct lock *lck, struct VSC_C_lck *st, const char *w)
ilck->stat = st;
ilck->stat->creat++;
AZ(pthread_mutex_init(&ilck->mtx, &attr));
- AZ(pthread_mutex_lock(&lck_mtx));
- VTAILQ_INSERT_TAIL(&ilck_head, ilck, list);
- AZ(pthread_mutex_unlock(&lck_mtx));
lck->priv = ilck;
}
@@ -240,9 +230,6 @@ Lck_Delete(struct lock *lck)
CAST_OBJ_NOTNULL(ilck, lck->priv, ILCK_MAGIC);
ilck->stat->destroy++;
lck->priv = NULL;
- AZ(pthread_mutex_lock(&lck_mtx));
- VTAILQ_REMOVE(&ilck_head, ilck, list);
- AZ(pthread_mutex_unlock(&lck_mtx));
AZ(pthread_mutex_destroy(&ilck->mtx));
FREE_OBJ(ilck);
}
@@ -259,7 +246,6 @@ LCK_Init(void)
#if !defined(__APPLE__) && !defined(__MACH__)
AZ(pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK));
#endif
- AZ(pthread_mutex_init(&lck_mtx, &attr));
#define LOCK(nam) \
lck_##nam = VSM_Alloc(sizeof(struct VSC_C_lck), \
VSC_CLASS, VSC_type_lck, #nam);
More information about the varnish-commit
mailing list