bugfix: main thread didn't always perform as many iterations as worker threads