public static AsyncLock GetLock( string path ) { var hash = path.GetHashCode(); lock ( _pathLocks ) { AsyncLock aLock = null; if ( _pathLocks.TryGetValue( hash, out aLock ) == false ) { aLock = _pathLocks[ hash ] = new AsyncLock(); } return aLock; } }
public static AsyncLock GetLock(string path) { var hash = path.GetHashCode(); lock (((ICollection)_pathLocks).SyncRoot) { AsyncLock alock = null; if (_pathLocks.TryGetValue( hash, out alock ) == false ) { alock = _pathLocks[ hash ] = new AsyncLock(); } return alock; } }
internal Releaser( AsyncLock toRelease ) { _toRelease = toRelease; }