Beispiel #1
0
 public void Close()
 {
     if (Interlocked.CompareExchange(ref _free, 1, 0) == 0)
     {
         Value = default(T);
         _context.Close(this);
     }
 }
Beispiel #2
0
        public void Close()
        {
            if (Interlocked.CompareExchange(ref _free, 1, 0) != 0)
            {
                return;
            }

            Value = default;
            _context.Close(this);
        }