tur/dynvar
stdlib/dynvar.tur
dynamic variables and binding conveyance for cooperative tasks.
Since: Phase DV3
defn
spawn-conveying
(spawn-conveying [f :ptr<void>])
spawn a thread that inherits the current binding frame.
Parameters
| f | zero-arg closure to run on the new thread |
Returns
A ptr<void> thread handle. Pass to thread-join or thread-detach.
Example
(binding [*log-level* 2]
(let [t (spawn-conveying (fn [] (println *log-level*)))]
(thread-join t)))
Since: DV3