开发者

System.ArgumentNullException in System.Threading.Monitor.Enter

I've got a code like this:

Some of our clients receiving "System.ArgumentNullException in System.Threading.Monitor.Enter" in the following code block:

Public Class CheckStuff

   Private Shared SLock As New Object

   Public Sub GetIt()
          Synclock SLock
             DoSomething()
          End Synclock       
   End Sub
End Class

How can this be possible? Considering the SLock is shared, never touched from anywhe开发者_JAVA百科re else?


My guess is that you've oversimplified your sample code - it must be touched from something else to make it Nothing. Or, your locking method is called before CheckStuff has finished initializing. A stack trace would be helpful.


Maybe similar problem - System.ArgumentNullException in ResourceManager.GetString internals.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜