Fix a degration.

Fix a degration that this was for single thread. Modify to multi
threads.