Пример #1
0
        /// <summary>Attempts to get value from the shared cache for the specified key.</summary>
        /// <param name="key">The key.</param>
        /// <param name="value">[out] The value.</param>
        /// <returns>true if it succeeds, false if it fails.</returns>
        public bool TryGetValue(int key, out SQLNETParallelItem value)
        {
            var bucket = key % Buckets.Length;

            bucket = bucket < 0 ? -bucket : bucket;
            return(Buckets[bucket].TryGetValue(key, out value));
        }
Пример #2
0
        public void TryRemove(SQLNETParallelItem value)
        {
            var bucket = value.ParallelId % Buckets.Length;

            bucket = bucket < 0 ? -bucket : bucket;
            Buckets[bucket].TryRemove(value);
        }
Пример #3
0
        /// <summary>Attempts to add a value in the shared cache for the specified key.</summary>
        /// <param name="value">The value.</param>
        /// <returns>true if it succeeds, false if it fails.</returns>
        public bool TryAdd(SQLNETParallelItem value)
        {
            var bucket = value.ParallelId % Buckets.Length;

            bucket = bucket < 0 ? -bucket : bucket;
            return(Buckets[bucket].TryAdd(value));
        }
Пример #4
0
 /// <summary>Attempts to get value from the shared cache for the specified key.</summary>
 /// <param name="key">The key.</param>
 /// <param name="value">[out] The value.</param>
 /// <returns>true if it succeeds, false if it fails.</returns>
 public bool TryGetValue(int key, out SQLNETParallelItem value)
 {
     var bucket = key%Buckets.Length;
     bucket = bucket < 0 ? -bucket : bucket;
     return Buckets[bucket].TryGetValue(key, out value);
 }
Пример #5
0
 public void TryRemove(SQLNETParallelItem value)
 {
     var bucket = value.ParallelId%Buckets.Length;
     bucket = bucket < 0 ? -bucket : bucket;
     Buckets[bucket].TryRemove(value);
 }
Пример #6
0
 /// <summary>Attempts to add a value in the shared cache for the specified key.</summary>
 /// <param name="value">The value.</param>
 /// <returns>true if it succeeds, false if it fails.</returns>
 public bool TryAdd(SQLNETParallelItem value)
 {
     var bucket = value.ParallelId%Buckets.Length;
     bucket = bucket < 0 ? -bucket : bucket;
     return Buckets[bucket].TryAdd(value);
 }