shithub: mc

ref: b31626248ea64c23d2020846e2cac1c751348b61
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
}