In article <200705170222.l4H2M9rU020152 / sharui.nakada.kanuma.tochigi.jp>,
Nobuyoshi Nakada  <nobu / ruby-lang.org> wrote:
>At Thu, 17 May 2007 03:25:05 +0900,
>Pete wrote in [ruby-talk:251828]:
>
>>The idea of the ensure was to release the semaphore if the callback hadn't
>> -- i.e. if break bypassed the yield.
>
>The ensure won't called until the callback released the
>semaphore because doeach waits it.
This was *not* what I observed.  I think what was happening was that
'break' was being invoked from another OS thread, so the ensure got run
too.  (I had printf telltales everywhere to show me which bits were
executing, and ensure got run even though doeach was still suspended.)
Rather a mess, in other words...

Anyhow, I've rewritten the code now to be a good single-threaded Ruby
citizen, and it's now working great!

					-- 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.)