I am having problem with ReaderWriterLockslim
. As you can see in the following code, I first gain the writelock, then I release it. But when it comes to release, it says that "The write lock is released without held". So I am stuck and I need help regarding this. There is no much information available regarding this on the internet.
RWLock.EnterWriteLock();
try
{
//Doublecheck
if (DateTime.Now.Subtract(LastRefresTime).TotalMinutes > Refr开发者_JAVA技巧eshTimeInterval.TotalMinutes)
{
_cacheObject = ReloadCache();
}
LastRefresTime = DateTime.Now;
}
finally
{
RWLock.ExitWriteLock();
}
精彩评论