Commit 1f490ae7 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Remove the list of all mutexes, we have never used it for anything.

parent 26039a79
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment