Return an error for invalid priority.
Only switch to a started thread if better priority.