-
Notifications
You must be signed in to change notification settings - Fork 1
LockableSlim
Jordan Duerksen edited this page May 15, 2018
·
5 revisions
LockableSlim uses a System.Threading.ReaderWriterLock to provide thread-safe access to an underlying value
using W;
public class LockableSlim<TValue>
{
public TValue Value {get; set;}
}//declare instance
protected LockableSlim<int> SomeInt { get; } = new LockableSlim<int>();You can pass in an initial value to the constructor:
public LockableSlim<string> Username { get; } = new LockableSlim<string>("Test User");