Breaks unit tests, e.g.: GOMAXPROCS=2 go test

Revert "simplify loop.go"

This reverts commit 937b678bd16fe53d51b5e9a8fd1dfd57d78d0b09.