示例#1
0
        public IReaderWriterLock GetStatementLock(String statementName, Attribute[] annotations, bool stateless)
        {
            bool foundNoLock = AnnotationUtil.FindAttribute(annotations, typeof(NoLockAttribute)) != null;

            if (_disableLocking || foundNoLock || stateless)
            {
                return(ReaderWriterLockManager.VoidLock());
            }

            if (_fairlocks)
            {
                return(ReaderWriterLockManager.FairLock());
            }

            return(ReaderWriterLockManager.CreateDefaultLock());
        }