"Bill Schwab" <
[hidden email]> wrote in message
news:dgp5rq$18jg$
[hidden email]...
> Ok, I'll bite :) I have always thought of #ensure: as being the last
> thing a thread does, and IIRC, the VM temporarily restarts it if
> necessary to run the code on the correct thread. Looking at it that
> way, your lesson strikes me as a natural outcome. Am I missing something?
It was me who had been missing something :) My mental image was that ensure
just gets executed moment you get out of the block either normaly, or by
exception, and in that image if ensure was nested inside exception handler,
it would surely be executed before exception handler. Yeah right.
The way they actually behave (as you and RTF Manual explain), is when thread
is at end and all exception handlers had their job done. It actually makes
much more sense, since exceptions could be restarted or ignored, and what
would happen if you ignore one, and restart the code, but inner ensure had
allready closed the file this code counts on.
rush
--
http://www.templatetamer.com/http://www.folderscavenger.com/