Fix concurrency handling in order to avoid that some workers get the same task at the same time.