From 210a63e2386e50a11421be03f536c789a7c1ef93 Mon Sep 17 00:00:00 2001 From: tinnus-napbus <77721746+tinnus-napbus@users.noreply.github.com> Date: Thu, 11 Mar 2021 00:24:30 +1300 Subject: [PATCH] strandio: fix await-thread and thread-result thread-result generated the tid twice and didn't take the kick caused by the child thread closing. Additionally, await-thread and thread-result expect a %thread-fail to produce [term (list tang)] rather than the actual [term tang]. This commit adds a take-kick, removes the duplicate tid line, and fixes the expected thread-fail type. --- pkg/arvo/lib/strandio.hoon | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/arvo/lib/strandio.hoon b/pkg/arvo/lib/strandio.hoon index a8b52ede1f..7ccbfcbca7 100644 --- a/pkg/arvo/lib/strandio.hoon +++ b/pkg/arvo/lib/strandio.hoon @@ -719,7 +719,7 @@ (pure:m tid) :: +$ thread-result - (each vase [term (list tang)]) + (each vase [term tang]) :: ++ await-thread |= [file=term args=vase] @@ -727,14 +727,14 @@ ^- form:m ;< =bowl:spider bind:m get-bowl =/ tid (scot %ta (cat 3 'strand_' (scot %uv (sham file eny.bowl)))) - =/ tid (scot %ta (cat 3 'strand_' (scot %uv (sham file eny.bowl)))) =/ poke-vase !>([`tid.bowl `tid file args]) ;< ~ bind:m (watch-our /awaiting/[tid] %spider /thread-result/[tid]) ;< ~ bind:m (poke-our %spider %spider-start poke-vase) ;< ~ bind:m (sleep ~s0) :: wait for thread to start ;< =cage bind:m (take-fact /awaiting/[tid]) + ;< ~ bind:m (take-kick /awaiting/[tid]) ?+ p.cage ~|([%strange-thread-result p.cage file tid] !!) %thread-done (pure:m %& q.cage) - %thread-fail (pure:m %| !<([term (list tang)] q.cage)) + %thread-fail (pure:m %| !<([term tang] q.cage)) == --