Skip to content

volight/Rwlock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rwlock

More friendly rwlock wraps

*must use using

Rwlock

using Volight.LockWraps;

var rwl = new Rwlock();


using (_ = rwl.Read()) {
    // .. do anything
}
// auto exit lock


using (_ = rwl.Write()) {
    // .. do anything
}
// auto exit lock

Rwlock<T>

var rwl = new Rwlock<int>(0);


using (var g = rwl.Read())
{
    // .. do anything
    Console.WriteLine(g.Value);
}
// auto exit lock


using (var g = rwl.Write())
{
    // .. do anything
    g.Value = 1;
}
// auto exit lock

Releases

No releases published

Packages

No packages published

Languages