;; forka and join
(bind-func fork-join
(lambda ()
(letz ((i 0))
(printout "Finish Order: ")
(sync
(dotimes (i 10)
(spawn (let ((jj i)) ;; each closure needs it's own i!
(lambda ()
(thread_sleep (dtoi64 (* 5. (random))) 0)
(printout jj)))))
1)
(println)
(println "Joined\n")
void)))