One thought before I quit for the night...

Thinking a bit more closely, the callback is of course in the (OS) thread
of the midi-handler, not the main thread that's running Ruby.  So when
a break occurs it must go back to *that* thread, not Ruby's.  This doesn't
actually seem to cause any immediate chaos -- before I put in the ensure
code, things would continue on quite normally after the break (with its
return value being reported and so on), until the semaphore actually timed out.
At which point, again, boom!

I may just be up against fundamental limits here.

					-- Pete --


-- 
============================================================================
The address in the header is a Spam Bucket -- don't bother replying to it...
(If you do need to email, replace the account name with my true name.)