C# Anyway to detect if an object is locked.

Posted by scope-creep on Stack Overflow See other posts from Stack Overflow or by scope-creep
Published on 2009-08-19T14:08:19Z Indexed on 2010/05/20 23:40 UTC
Read the original article Hit count: 154

Filed under:
|

Hi,

Is their anyway to determine if a object is locked in c#. I have the unenviable position, through design where i'm reading from a queue inside a class, and I need to dump the contents into a collection in the class. But that collection is also read/write from an interface outside the class. So obviously their may be a case when the collection is being written to, as the same time i want to write to it.

I could program round it, say using delegate but it would be ugly.

Bob.

© Stack Overflow or respective owner

Related posts about c#3.0

Related posts about multithreading