C#中的Lock语句,在VB.NET中是否有等价物? [英] Lock statement in C#, Is there an equivalent in VB.NET?

查看:75
本文介绍了C#中的Lock语句,在VB.NET中是否有等价物?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



主题说明了一切。在VB.NET中是否有等价的C#

语句锁定(对象){}


谢谢


ThunderMusic

Hi,
The subject says it all. Is there an equivalent, in VB.NET, for the C#
statement Lock(Object){}

Thanks

ThunderMusic

推荐答案


http://msdn.microsoft.com/library/de...kStatement.asp


" lock关键字将语句块标记为关键部分

获取给定对象的互斥锁,执行

语句,然后释放锁。此声明采用

以下表格:


lock(表达式)statement_block


其中:


表达式

指定要锁定的对象。表达式必须是

引用类型。


ThunderMusic写道:

http://msdn.microsoft.com/library/de...kStatement.asp

"The lock keyword marks a statement block as a critical section by
obtaining the mutual-exclusion lock for a given object, executing a
statement, and then releasing the lock. This statement takes the
following form:

lock(expression) statement_block

where:

expression
Specifies the object that you want to lock on. expression must be a
reference type."

ThunderMusic wrote:

主题说出来所有。在VB.NET中是否有等价的C#
语句Lock(Object){}

谢谢

ThunderMusic
Hi,
The subject says it all. Is there an equivalent, in VB.NET, for the C#
statement Lock(Object){}

Thanks

ThunderMusic



" ThunderMusic" < NO.danlat.at.hotmail.com.SPAM> schrieb:
"ThunderMusic" <NO.danlat.at.hotmail.com.SPAM> schrieb:
主题说明了一切。在VB.NET中是否存在等效的C#
语句Lock(Object){}
The subject says it all. Is there an equivalent, in VB.NET, for the C#
statement Lock(Object){}




''SyncLock''。


-

MS Herfried K. Wagner

MVP< URL:http://dotnet.mvps.org/>

VB< URL:http://classicvb.org/petition/>



''SyncLock''.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


AFAIK这是SyncLock声明...


-

Patrice


ThunderMusic < NO.danlat.at.hotmail.com.SPAM> aécritdansle message de

news:uO ************** @ TK2MSFTNGP10.phx.gbl ...
AFAIK this is the "SyncLock" statement...

--
Patrice

"ThunderMusic" <NO.danlat.at.hotmail.com.SPAM> a écrit dans le message de
news:uO**************@TK2MSFTNGP10.phx.gbl...

主题说明了一切。在VB.NET中是否有等价的C#
语句Lock(Object){}

谢谢

ThunderMusic
Hi,
The subject says it all. Is there an equivalent, in VB.NET, for the C#
statement Lock(Object){}

Thanks

ThunderMusic



这篇关于C#中的Lock语句,在VB.NET中是否有等价物?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆