An open API service indexing awesome lists of open source software.

https://github.com/volight/rwlock

More friendly rwlock wraps
https://github.com/volight/rwlock

Last synced: about 1 year ago
JSON representation

More friendly rwlock wraps

Awesome Lists containing this project

README

          

# Rwlock

More friendly rwlock wraps

**\*must use using**

### Rwlock

```csharp
using Volight.LockWraps;

var rwl = new Rwlock();

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

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

### Rwlock\

```csharp
var rwl = new Rwlock(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
```