示例#1
0
            public override void Dispose()
            {
                // NOTE that despite the use of Interlocked here, this class is not thread-safe
                var innerHandle = Interlocked.Exchange(ref this.baseHandle, null);

                if (innerHandle != null)
                {
                    // sp_getapplock must be exited for each time it is entered
                    this.upgradedHandle?.Dispose();
                    innerHandle.Dispose();
                    this.@lock = null;
                }
            }
示例#2
0
 public InternalUpgradeableHandle(SqlDistributedReaderWriterLock @lock, IDisposable baseHandle)
 {
     this.@lock      = @lock;
     this.baseHandle = baseHandle;
 }