shithub: mc

ref: f6eb57283f625cbd20d5bb423331e88ddc82c8f1
dir: /lib/thread/do.myr/

View raw version
use std

use "future"
use "spawn"

pkg thread =
	generic do	: (fn : (-> @a) -> future(@a)#)
;;

generic do = {fn
	var r

	r = mkfut()
	spawn({; futput(r, fn()) })
	-> r
}