shithub: mc

Download patch

ref: 63dc379b326e11226c34c807f210bb92af6fe602
parent: 28407c92feaf5fc5f5925e0e05bec4508b172ee2
author: Ori Bernstein <ori@eigenstate.org>
date: Wed Sep 12 16:05:45 EDT 2018

Wait can't always be called from other procs.

--- a/lib/thread/test/do.myr
+++ b/lib/thread/test/do.myr
@@ -2,16 +2,16 @@
 use thread
 
 const main = {
-	match std.espork(["echo", "hello"][:])
+	match std.espork(["/bin/echo", "hello"][:])
 	| `std.Err e:
 		std.fatal("could not spork\n")
 	| `std.Ok (pid, in, out, err):
 		std.close(in)
-		var w = thread.do({;-> std.wait(pid)})
 		var o = thread.do({;-> std.fslurp(out)})
 		var e = thread.do({;-> std.fslurp(err)})
+		var w = std.wait(pid)
 
-		match thread.futget(w)
+		match w
 		| `std.Wsuccess:	/* ok */
 		| bad:	std.fatal("bad wait: {}\n", bad)
 		;;