RaspberryIO/Unosquare.Swan.Lite/Abstractions/ISyncLocker.cs
2019-12-04 17:10:06 +01:00

23 lines
697 B
C#

using System;
namespace Unosquare.Swan.Abstractions {
/// <summary>
/// Defines a generic interface for synchronized locking mechanisms.
/// </summary>
public interface ISyncLocker : IDisposable {
/// <summary>
/// Acquires a writer lock.
/// The lock is released when the returned locking object is disposed.
/// </summary>
/// <returns>A disposable locking object.</returns>
IDisposable AcquireWriterLock();
/// <summary>
/// Acquires a reader lock.
/// The lock is released when the returned locking object is disposed.
/// </summary>
/// <returns>A disposable locking object.</returns>
IDisposable AcquireReaderLock();
}
}