Skip to content

Commit

Permalink
vere: add flag to continue running after behn: queue blocked (#618)
Browse files Browse the repository at this point in the history
This problem is very tedious to work around without a way to keep
running even without timers.
  • Loading branch information
pkova authored Mar 8, 2024
2 parents 9809cd9 + 5c44fbc commit d7a8827
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/vere/io/behn.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,14 @@ _behn_wake_bail(u3_ovum* egg_u, u3_noun lud)

u3l_log("behn: timer failed; queue blocked");

// XX review, add flag to continue?
//
u3_pier_bail(car_u->pir_u);
if ( c3n == u3_Host.ops_u.beb ) {
u3_pier_bail(car_u->pir_u);
}
else {
u3l_log("vere: warning: continuing without timers");
u3z(lud);
u3_ovum_free(egg_u);
}
}
}

Expand Down
6 changes: 6 additions & 0 deletions pkg/vere/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ _main_init(void)
u3_Host.ops_u.rep = c3n;
u3_Host.ops_u.eph = c3n;
u3_Host.ops_u.tos = c3n;
u3_Host.ops_u.beb = c3n;
u3_Host.ops_u.tem = c3n;
u3_Host.ops_u.tex = c3n;
u3_Host.ops_u.tra = c3n;
Expand Down Expand Up @@ -278,6 +279,7 @@ _main_getopt(c3_i argc, c3_c** argv)
{ "swap", no_argument, NULL, 7 },
{ "swap-to", required_argument, NULL, 8 },
{ "toss", required_argument, NULL, 9 },
{ "behn-allow-blocked", no_argument, NULL, 10 },
//
{ NULL, 0, NULL, 0 },
};
Expand Down Expand Up @@ -313,6 +315,10 @@ _main_getopt(c3_i argc, c3_c** argv)
}
break;
}
case 10: { // behn-allow-blocked
u3_Host.ops_u.beb = c3y;
break;
}
// special args
//
case c3__loom: {
Expand Down
1 change: 1 addition & 0 deletions pkg/vere/vere.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@
c3_o map; // --no-demand (reversed)
c3_o eph; // --swap, use ephemeral file
c3_o tos; // --toss, discard ephemeral
c3_o beb; // --behn-allow-blocked
} u3_opts;

/* u3_host: entire host.
Expand Down

0 comments on commit d7a8827

Please sign in to comment.