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.
精彩评论