Commit b04b136c authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Add a signal_close callback method to stevedores, which can be used to

signal background threads to stop in preparation for the coming close
callback.
parent b468fff3
......@@ -436,6 +436,15 @@ STV_close(void)
{
struct stevedore *stv;
/* Signal intent to close */
VTAILQ_FOREACH(stv, &stv_stevedores, list)
if (stv->signal_close != NULL)
stv->signal_close(stv);
stv = stv_transient;
if (stv->signal_close != NULL)
stv->signal_close(stv);
/* Close each in turn */
VTAILQ_FOREACH(stv, &stv_stevedores, list)
if (stv->close != NULL)
stv->close(stv);
......
......@@ -47,6 +47,7 @@ typedef void storage_free_f(struct storage *);
typedef struct object *storage_allocobj_f(struct stevedore *, struct busyobj *,
struct objcore **, unsigned ltot, const struct stv_objsecrets *);
typedef void storage_close_f(const struct stevedore *);
typedef void storage_signal_close_f(const struct stevedore *);
/* Prototypes for VCL variable responders */
#define VRTSTVTYPE(ct) typedef ct storage_var_##ct(const struct stevedore *);
......@@ -69,6 +70,7 @@ struct stevedore {
storage_free_f *free; /* --//-- */
storage_close_f *close; /* --//-- */
storage_allocobj_f *allocobj; /* --//-- */
storage_signal_close_f *signal_close; /* --//-- */
struct lru *lru;
......
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