Skip to content

unintelligible/NamedReaderWriterLockSlim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Usage:

private static NamedReaderWriterLock<string> locker = new NamedReaderWriterLock<string>();
public void DoSomethingConcurrent(string lockName)
{
    using (locker.LockRead(url))
    {
       //Do something concurrent that only requires
       //read access to the resource
    }
    using (locker.LockUpgradeableRead(url))
    {
       //Do something concurrent that only requires
       //read access to the resource, but that may require
       //upgrading to a Write lock later in the code
    }
    using (locker.LockWrite(url))
    {
       //Do something concurrent that requires
       //write access to the resource
    }
}

See the home page for more information.

Releases

No releases published

Packages

No packages published

Languages