A lot of examples for the ReaderWriterLockSlim are written this way:
public string Read(int key)
{
cacheLock.EnterReadLock(); // is there a reason for this
try
{
return innerCache[key];
}
finally
{
cacheLock.ExitReadLock();
}
}
Is there a real reason for the EnterLock to be outside the try block ?