Quote:
Originally Posted by BaussHacker
You shouldn't use Monitor for every thread.
|
if you know how to use it you should be able to use it whenever you need it and with out any problems .
IE.
Monitor.enter(object)
try
{
add or copy or remove or value =
from object and keep going
}
finally { Monitor.exit(object); }
none of whats mentioned up there blocks .
any exceptions and the lock well be released giving the next waiting thread a chance to obtain the lock . a catch(Ex) might be needed
@BaussHacker the attached is something that can be useful. why not create/edit your own monitor. its meant to deal with any dead locks (if any located)
another PS. i dident create that monitor class in side attached .cs file