System.Net.Sockets.OverlappedCache.InterlockedFree C# (CSharp) Method

InterlockedFree() static private method

static private InterlockedFree ( OverlappedCache &overlappedCache ) : void
overlappedCache OverlappedCache
return void
        internal static void InterlockedFree(ref OverlappedCache overlappedCache)
        {
            OverlappedCache cache = overlappedCache == null ? null : Interlocked.Exchange<OverlappedCache>(ref overlappedCache, null);
            if (cache != null)
            {
                cache.Free();
            }
        }

Usage Example

 protected virtual void ForceReleaseUnmanagedStructures()
 {
     this.ReleaseGCHandles();
     GC.SuppressFinalize(this);
     if ((this.m_UnmanagedBlob != null) && !this.m_UnmanagedBlob.IsInvalid)
     {
         this.m_UnmanagedBlob.Close(true);
         this.m_UnmanagedBlob = null;
     }
     OverlappedCache.InterlockedFree(ref this.m_Cache);
     if (this.m_OverlappedEvent != null)
     {
         this.m_OverlappedEvent.Close();
         this.m_OverlappedEvent = null;
     }
 }
All Usage Examples Of System.Net.Sockets.OverlappedCache::InterlockedFree