shithub: mc

ref: 895c8ae58de3ece766a1f9d70094f61adb864f71
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
}