Correcting the chaotic solution
Now the threads print the items count before sleep