Source/NFX/Collections/NamedInterlocked.cs
/// <summary>
/// Enumerates all named integers. This operation is thread-safe, and returns a snapshot of the instance taken at the time of the first call.
/// If exchange is specified, atomicaly flips the value of every slot
/// </summary>
Enumerates all named integers. This operation is thread-safe, and returns a snapshot of the instance taken at the time of the first call.
If exchange is specified, atomicaly flips the value of every slot
Enumerates all named integers . This operation is thread - safe and returns a snapshot of the instance taken at the time of the first call . If exchange is specified atomicaly flips the value of every slot
public IEnumerable<KeyValuePair<string, long>> SnapshotAllLongs(long? exchange = null)
      {
        if (exchange.HasValue)
          return m_Data.Select(s => new KeyValuePair<string, long>(s.Name, Interlocked.Exchange(ref s.Long, exchange.Value)));
        return m_Data.Select(s => new KeyValuePair<string, long>(s.Name, s.Long));
      }
public IEnumerable < KeyValuePair < string , long > > SnapshotAllLongs ( long ? exchange = null ) { if ( exchange . HasValue ) return m_Data . Select ( s => new KeyValuePair < string , long > ( s . Name , Interlocked . Exchange ( ref s . Long , exchange . Value ) ) ) ; return m_Data . Select ( s => new KeyValuePair < string , long > ( s . Name , s . Long ) ) ; }
Enumerates all named integers.
Enumerates all named integers .
exchange
long?