c# - ReaderWriterLockSlim.TryEnterUpgradeableReadLock(0) is blocking -


in .net application, i've place declare readerwriterlockslim:

    private readonly readerwriterlockslim m_lock = new readerwriterlockslim(lockrecursionpolicy.supportsrecursion); 

at other place, refresh value every 100ms, if 1 time, lock isn't accessible, isn't big deal, want exit , wait next call.

so i've following method's content:

if (m_lock.tryenterupgradeablereadlock(0)){    .. } 

in application, i'm having deadlocks(which seems have nothing current issue), paused application check threads , saw i've more 20 threads blocked on if condition.

this weird, because the documentation clear this:

if millisecondstimeout 0 (zero), method checks lock state , returns false if desired state unavailable.

the question simple. whyyyyyyyyyyyyyyyyyyy? tried put breakpoints after tryenterupgradeable, continue, doesn't work.


Comments

Popular posts from this blog

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -