mirror of
https://github.com/mirror/processhacker
synced 2026-06-08 16:03:24 +00:00
b02427417c
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@5614 21ef857c-d57f-4fe0-8362-d861dc6d29cd
42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace ProcessHacker.Common.Threading
|
|
{
|
|
public interface IResourceLock
|
|
{
|
|
/// <summary>
|
|
/// Acquires the lock in exclusive mode, blocking if necessary.
|
|
/// </summary>
|
|
void AcquireExclusive();
|
|
|
|
/// <summary>
|
|
/// Acquires the lock in shared mode, blocking if necessary.
|
|
/// </summary>
|
|
void AcquireShared();
|
|
|
|
/// <summary>
|
|
/// Releases the lock in exclusive mode.
|
|
/// </summary>
|
|
void ReleaseExclusive();
|
|
|
|
/// <summary>
|
|
/// Releases the lock in shared mode.
|
|
/// </summary>
|
|
void ReleaseShared();
|
|
|
|
/// <summary>
|
|
/// Attempts to acquire the lock in exclusive mode.
|
|
/// </summary>
|
|
/// <returns>Whether the lock was acquired.</returns>
|
|
bool TryAcquireExclusive();
|
|
|
|
/// <summary>
|
|
/// Attempts to acquire the lock in shared mode.
|
|
/// </summary>
|
|
/// <returns>Whether the lock was acquired.</returns>
|
|
bool TryAcquireShared();
|
|
}
|
|
}
|