It's synchronized by the call to `Splice(DevNull, local)`, which shuttles messages back and forth between 2 streams until they are closed.

In this case it's shuttling messages between `DevNull` (which never closes) and the pipe which has been sent to the goroutine. When the goroutine completes, it will close the other end of the pipe, causing `Splice` to return.