Commit 42a844a2 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Code Polish

parent a7c18717
...@@ -656,7 +656,7 @@ void BAN_Reload(double t0, unsigned flags, const char *ban); ...@@ -656,7 +656,7 @@ void BAN_Reload(double t0, unsigned flags, const char *ban);
struct ban *BAN_TailRef(void); struct ban *BAN_TailRef(void);
void BAN_Compile(void); void BAN_Compile(void);
struct ban *BAN_RefBan(struct objcore *oc, double t0, const struct ban *tail); struct ban *BAN_RefBan(struct objcore *oc, double t0, const struct ban *tail);
void BAN_Deref(struct ban **ban); void BAN_TailDeref(struct ban **ban);
/* cache_center.c [CNT] */ /* cache_center.c [CNT] */
void CNT_Session(struct sess *sp); void CNT_Session(struct sess *sp);
......
...@@ -549,11 +549,11 @@ ban_lurker(struct sess *sp, void *priv) ...@@ -549,11 +549,11 @@ ban_lurker(struct sess *sp, void *priv)
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
* Release a reference * Release a tail reference
*/ */
void void
BAN_Deref(struct ban **bb) BAN_TailDeref(struct ban **bb)
{ {
struct ban *b; struct ban *b;
......
...@@ -303,8 +303,8 @@ smp_thread(struct sess *sp, void *priv) ...@@ -303,8 +303,8 @@ smp_thread(struct sess *sp, void *priv)
smp_load_seg(sp, sc, sg); smp_load_seg(sp, sc, sg);
sc->flags |= SMP_SC_LOADED; sc->flags |= SMP_SC_LOADED;
BAN_Deref(&sc->tailban); BAN_TailDeref(&sc->tailban);
sc->tailban = NULL; AZ(sc->tailban);
printf("Silo completely loaded\n"); printf("Silo completely loaded\n");
while (1) { while (1) {
(void)sleep (1); (void)sleep (1);
...@@ -352,6 +352,11 @@ smp_open(const struct stevedore *st) ...@@ -352,6 +352,11 @@ smp_open(const struct stevedore *st)
if (smp_open_segs(sc, &sc->seg1)) if (smp_open_segs(sc, &sc->seg1))
AZ(smp_open_segs(sc, &sc->seg2)); AZ(smp_open_segs(sc, &sc->seg2));
/*
* Grap a reference to the tail of the ban list, until the thread
* has loaded all objects, so we can be sure that all of our
* proto-bans survive until then.
*/
sc->tailban = BAN_TailRef(); sc->tailban = BAN_TailRef();
AN(sc->tailban); AN(sc->tailban);
......
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