J
Johan Karlsson
Hi all!
I just need a true or false answer for this statement.
Consider having a piece of code that boils down to this
Dim a = new ArrayList
SyncLock a
SyncLock a
a.Add("Something")
End SyncLock
End SyncLock
The question: Since it is the same thread that locks the resource twice the
add function will execute without problems, right? And other threads trying
to lock will just have to wait 'til their turn?
Another question while im at it: If all lockings withing an assembly only
refer to a single object, that is there is not "nested" locking, a deadlock
can never occour? Right or wrong? Need some more clarification?
Thanks!
/Johan
I just need a true or false answer for this statement.
Consider having a piece of code that boils down to this
Dim a = new ArrayList
SyncLock a
SyncLock a
a.Add("Something")
End SyncLock
End SyncLock
The question: Since it is the same thread that locks the resource twice the
add function will execute without problems, right? And other threads trying
to lock will just have to wait 'til their turn?
Another question while im at it: If all lockings withing an assembly only
refer to a single object, that is there is not "nested" locking, a deadlock
can never occour? Right or wrong? Need some more clarification?
Thanks!
/Johan