ref: 905f4d10a78e7e2f6eb849cf373b14cd78c87d73
dir: /lib/thread/test/waitgrp.myr/
use std
use thread
const Threadc = 8
var wg
const main = {
wg = thread.mkwg(Threadc)
for var i = 0; i < Threadc; i++
thread.spawn({
std.usleep(3_000_000)
thread.wgpost(&wg)
thread.wgwait(&wg)
})
;;
thread.wgwait(&wg)
}