add priority inversion in scheduler