How to know if a ReaderWriterLockSlim is currently write-locked by another thread?
ReaderWriterLockSlim rwls = new ReaderWriterLockSlim()
var i = rwls.CurrentReadCount;
// count of reading threads (but unfortunately there's no CurrentWriteCount property)
var j = rwls.IsWriteLockHeld;
// check if current thread is holding the lock (limited to current thread)
/* none of above can do it */
yes I can call rwls.TryEnterWriteLock(1) to check if it is write-locked but that will slow down the performence
are there any direct way to get write-lock status ?