using System; using System.Collections.Generic; using System.Text; namespace ProcessHacker.Common.Threading { public interface IResourceLock { /// /// Acquires the lock in exclusive mode, blocking if necessary. /// void AcquireExclusive(); /// /// Acquires the lock in shared mode, blocking if necessary. /// void AcquireShared(); /// /// Releases the lock in exclusive mode. /// void ReleaseExclusive(); /// /// Releases the lock in shared mode. /// void ReleaseShared(); /// /// Attempts to acquire the lock in exclusive mode. /// /// Whether the lock was acquired. bool TryAcquireExclusive(); /// /// Attempts to acquire the lock in shared mode. /// /// Whether the lock was acquired. bool TryAcquireShared(); } }