开发者

ReaderWriterLockSlim throwing exception "the write lock is released without held"

开发者 https://www.devze.com 2023-03-12 15:52 出处:网络
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 relea

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();

}
0

精彩评论

暂无评论...
验证码 换一张
取 消