开发者

System.ArgumentNullException in System.Threading.Monitor.Enter

开发者 https://www.devze.com 2022-12-09 18:53 出处:网络
I\'ve got a code like this: Some of our clients receiving \"System.ArgumentNullExceptionin System.Threading.Monitor.Enter\" in the following code block:

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

精彩评论

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