So let's say I have an ASP.Net website, and I place some object to Cache in the page A.aspx.vb as follows:
Dim o As New Object()
Context.Cache.Insert(key, o, ...other required arguments)
Now in the page B.aspx.vb I do this:
Dim o as Object = Context.Cache(key)
If o IsNot Nothing
SyncLock o
...do something with o
End SyncLock
End If
Now if two instances of the page B.aspx.vb execute simultaneously, and use the same key to retrieve o from cache, will one page wait for the other to exit the SyncLock region? o is an instance variable, but for both instances of the class representing my page B it points to the same instance of the object in Cache.