473,473 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1632
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ram | last post by:
Hey, I have about 5 Shared variables, that I want to be locked for access when they are written to. I'v read in the MSDN about the SyncLock statement, and I'm prety sure that's what I'm looking...
10
by: Bob Day | last post by:
Using vs 2003, vb.net sql msde.. Consider the following code snippets. See **** for questions. All are shared and accessed by multiple threads simultaneiously. ' Instantiate per for this...
3
by: Bob Day | last post by:
Ok, I have done a lot of reading(of the newsgroup answers, help files and MSDN articles) of synclock. I understand what you are saying in the newsgroup, and it is very helpful. It does, however,...
4
by: fred | last post by:
I use a Synclock in a secondary thread and also stop the thread using the abort method. If the abort occurs while the thread is in the Synclock will the SyncLock always be released before the...
6
by: Johan Karlsson | last post by:
Hi all! I just need a true or false answer for this statement. Consider having a piece of code that boils down to this Dim a = new ArrayList SyncLock a SyncLock a a.Add("Something") End...
3
by: Ram | last post by:
Hey, I have about 5 Shared variables, that I want to be locked for access when they are written to. I'v read in the MSDN about the SyncLock statement, and I'm prety sure that's what I'm looking...
4
by: Jeff Stewart | last post by:
Specifically, I don't understand the parameter that Synclock accepts. How is a reference type a lockable entity? What -is- a reference type? Is it a number? Is it a value at a specific memory...
3
by: Chris Dunaway | last post by:
I was using a Queue object like this to create my own specialized queue class for use with my own objects: Public Class MySpecializedQueue Private q As New Queue Public Sub Enqueue(obj As...
1
by: Perecli Manole | last post by:
Can an Exit Sub statement in a SyncLock block cause any problems with the proper release of the locked resource or affect the Monitor's waiting queue in any way? Thanks Perry
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.