Or use Monitor.Enter:

Refer to: http://msdn.microsoft.com/en-us/library/de0542zz%28VS.71%29.aspx


Regards,


Benj



On Feb 21, 1:27 pm, Aaron Wang <[email protected]> wrote:
> the most easy way:
> private static object _objState = new object();
>
> method ()
> {
>     lock(_objState)
>     {
>          //your codes that cannot be executed at two threads at same time.
>     }
>
> }

-- 
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net

Reply via email to