Synclock statement, no try finally emitted to IL?

  • Thread starter Thread starter Eric Newton
  • Start date Start date
E

Eric Newton

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,
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
 
I stand corrected.

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