ref: d87c0959d85b40fcf60b9c6dd0a2f2111f888b55
dir: /lib/thread/test/future.myr/
use std
use sys
use thread
const main = {
var f
f = thread.mkfut()
thread.futput(f, 123)
std.assert(thread.futget(f) == 123, "the future is broken\n")
f = thread.mkfut()
thread.spawn({
std.usleep(10_000)
thread.futput(f, 321)
})
std.assert(thread.futget(f) == 321, "the future is broken\n")
}