Skip to content

Commit c735b3c

Browse files
committed
Expose timed-wait
1 parent bf2caf4 commit c735b3c

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

Diff for: host.c

+14-3
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,27 @@ able_host_exec(able_host_t *host) {
2424
return y;
2525
}
2626
switch (host->c.i) {
27-
case 0x80: { // wait ( p - n)
28-
if (DSU(&host->c, 1))
27+
case 0x80: { // wait ( t p - n)
28+
if (DSU(&host->c, 2))
2929
return -6;
3030
uint32_t pn;
3131
pn = DS0;
32+
DSD(&host->c);
3233
if (pn >= host->pc) {
3334
DS0 = 4;
3435
break;
3536
}
36-
DS0 = able_host_node_wait_shim(host->n, &host->p[pn].e, NULL);
37+
struct timespec ts;
38+
struct timespec *tp;
39+
tp = NULL;
40+
uint64_t tv;
41+
tv = DS0;
42+
if (tv != -1) {
43+
ts.tv_sec = tv / 1000000000;
44+
ts.tv_nsec = tv % 1000000000;
45+
tp = &ts;
46+
}
47+
DS0 = able_host_node_wait_shim(host->n, &host->p[pn].e, tp);
3748
if (DS0 == 0)
3849
return -5;
3950
break;

0 commit comments

Comments
 (0)