Source/NFX/KeyedMonitor.cs
/// <summary>
/// Performs Monitor.Enter() on TKey value.
/// Unlike TryEnter() this method does block
/// </summary>
Performs Monitor.Enter() on TKey value.
Unlike TryEnter() this method does block
Performs Monitor . Enter () on TKey value . Unlike TryEnter () this method does block
public void Enter(TKey key)
    {
      var bucket = getBucket(key);
      _slot _lock;
      lock(bucket)
      {
        if (!bucket.TryGetValue(key, out _lock))
        {
          _lock = new _slot();
          bucket.Add(key, _lock);
        }
        else
          _lock.RefCount++;
      }
      Monitor.Enter(_lock);
    }
public void Enter ( TKey key ) { var bucket = getBucket ( key ) ; _slot _lock ; lock ( bucket ) { if ( ! bucket . TryGetValue ( key , out _lock ) ) { _lock = new _slot ( ) ; bucket . Add ( key , _lock ) ; } else _lock . RefCount ++ ; } Monitor . Enter ( _lock ) ; }
Performs Monitor.Enter() on TKey value.
Performs Monitor . Enter () on TKey value .
key
TKey