Add mutex to wait play thread safely