shithub: mc

ref: 537313ee9a2179cc6e869c6e8c70da4af1f07f28
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
}