You can use Monitor.TryEnter(theObject) to try to use the object in a
lock. If it returns false, the object is already used in a lock. If it
returns true, you have successfully used it in a lock.
Note: Using an object in a lock doesn't protect the object in any way,
it only stops any other code to use the same object in a lock.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.