RaspberryIO_26/Swan.Lite/Threading/ISyncLocker.cs

23 lines
682 B
C#
Raw Normal View History

2019-12-04 18:57:18 +01:00
using System;
2019-12-08 19:54:52 +01:00
namespace Swan.Threading {
/// <summary>
/// Defines a generic interface for synchronized locking mechanisms.
/// </summary>
public interface ISyncLocker : IDisposable {
2019-12-04 18:57:18 +01:00
/// <summary>
2019-12-08 19:54:52 +01:00
/// Acquires a writer lock.
/// The lock is released when the returned locking object is disposed.
2019-12-04 18:57:18 +01:00
/// </summary>
2019-12-08 19:54:52 +01:00
/// <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();
}
2019-12-04 18:57:18 +01:00
}