471,078 Members | 844 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,078 software developers and data experts.

Synclock statement, no try finally emitted to IL?

I find it curious that the Synclock...End Synclock do not emit a try finally
as well...

SyncLock Me
Me.someOperation()
End SyncLock

I would expect to see in the generated code:
try
Monitor.Enter(Me)
Me.SomeOperation()
finally
Monitor.Exit(Me)
end try

but it doesnt emit the try finally construct

anybody else find this strange? I definitely find this strange

--
Eric Newton
C#/ASP Application Developer
http://ensoft-software.com/
er**@cc.ensoft-software.com [remove the first "CC."]
Nov 20 '05 #1
2 1555
Eric,
I find it curious that the Synclock...End Synclock do not emit a try finally
as well...


It does. Where/how are you viewing the generated IL code? I clearly
see the SEH stuff there. If you're using ILDASM, do you have the
"Expand try/catch" option turned on?

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 20 '05 #2
I stand corrected.

I was using the Lutz Roeder .NET decompiler, it shows no try finally...
bizarre...

--
Eric Newton
C#/ASP Application Developer
http://ensoft-software.com/
er**@cc.ensoft-software.com [remove the first "CC."]

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:ed*************@TK2MSFTNGP12.phx.gbl...
Eric,
I find it curious that the Synclock...End Synclock do not emit a try finallyas well...


It does. Where/how are you viewing the generated IL code? I clearly
see the SEH stuff there. If you're using ILDASM, do you have the
"Expand try/catch" option turned on?

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Ram | last post: by
10 posts views Thread by Bob Day | last post: by
4 posts views Thread by fred | last post: by
6 posts views Thread by Johan Karlsson | last post: by
3 posts views Thread by Ram | last post: by
4 posts views Thread by Jeff Stewart | last post: by
3 posts views Thread by Chris Dunaway | last post: by
1 post views Thread by Perecli Manole | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.