Fixed a nasty sched-design flaw that might have produced very random output
Commit full of sighs. It is still racy.