Various restructuring has made it possible to do all post-wakeup processing in sleepq_resume_thread() where the thread lock is already held. This will permit a follow-up commit where sched_switch() does not return with the thread lock held. I also believe the resulting code looks cleaner.
This has passed stress2