Multithreading: fixing a problem

https://ift.tt/2pL5ztg