shithub: mc

ref: 9892228031c0ffcfa95a1443fc565b031525bb3a
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
}