fn</span> <span class='ident'>main</span>() {
    <span class='ident'>thread</span>::<span class='ident'>spawn</span>(<span class='op'>||</span> {
        <span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>&quot;Hello from a thread!&quot;</span>);
    });
}</pre>

<!-- The `thread::spawn()` method accepts a [closure](closures.html), which is executed in a -->

<!-- new thread. It returns a handle to the thread, that can be used to -->

<!-- wait for the child thread to finis