Exemple #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));
        }
Exemple #2
0
        public void TryRemove(SQLNETParallelItem value)
        {
            var bucket = value.ParallelId % Buckets.Length;

            bucket = bucket < 0 ? -bucket : bucket;
            Buckets[bucket].TryRemove(value);
        }
Exemple #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));
        }
 /// <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);
 }
 public void TryRemove(SQLNETParallelItem value)
 {
     var bucket = value.ParallelId%Buckets.Length;
     bucket = bucket < 0 ? -bucket : bucket;
     Buckets[bucket].TryRemove(value);
 }
 /// <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);
 }