checking for empty ready queue before getting front for next thread