Exemplo n.º 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;
                }
            }
Exemplo n.º 2
0
 public InternalUpgradeableHandle(SqlDistributedReaderWriterLock @lock, IDisposable baseHandle)
 {
     this.@lock      = @lock;
     this.baseHandle = baseHandle;
 }