Create a varnish lock class

parent e1162cdd
......@@ -48,7 +48,13 @@
#include "tus_blob.h"
#include "tus_file_exp_setup.h"
/* ============================================================
* vmod shared object globals
*/
static unsigned refcnt = 0;
static struct vsc_seg *vsc_seg_lck = NULL;
struct VSC_lck *lck_fcore = NULL;
/* ============================================================
* vmod init/fini
......@@ -62,6 +68,9 @@ tus_init(VRT_CTX, struct vmod_priv *priv)
if (refcnt++ > 0)
return (0);
AZ(vsc_seg_lck);
lck_fcore = Lck_CreateClass(&vsc_seg_lck, "tus.fcore");
AN(lck_fcore);
tus_file_init();
return (tus_chksum_init(ctx));
}
......@@ -75,6 +84,7 @@ tus_fini(VRT_CTX, struct vmod_priv *priv)
if (refcnt > 0)
return (0);
Lck_DestroyClass(&vsc_seg_lck);
return (tus_chksum_fini(ctx));
}
......
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