finish waiting queue and executing thread logic