Bug 11580 points out a problem related to persistence of the scheduler locking mode. If you set the mode to "on" (which means that only one thread can run), and then kill and restart your program, the mode persists and your program may deadlock. I don't think this is a problem for mode "step", and it could be argued that mode "on" is "use at your own risk". However I've been thinking about how to resolve it, and this simple but intrusive patch is what I come up with. Comments?