This IDisposable uses the ReaderWriterLockSlim for critical sections that allow one writer and multiple reader. The counter parts are WriteLock and UpgradeableReadLock. It is used to replaces try-finally blocks with "using" statements.
More...
|
static IDisposable | Enter (ReaderWriterLockSlim syncObject) |
| Enters a critical section with ReaderWriterLockSlim.EnterReadLock and returns a new instance of ReadLock. More...
|
|
static IDisposable | TryEnter (ReaderWriterLockSlim syncObject, int millisecondsTimeout) |
| Enters a critical section with ReaderWriterLockSlim.TryEnterReadLock(int) and returns a new instance of ReadLock. More...
|
|
This IDisposable uses the ReaderWriterLockSlim for critical sections that allow one writer and multiple reader. The counter parts are WriteLock and UpgradeableReadLock. It is used to replaces try-finally blocks with "using" statements.
using (ReadLock.Enter(rwLock))
{
}
◆ Dispose()
void ExitGames.Threading.ReadLock.Dispose |
( |
| ) |
|
|
inline |
Calls ReaderWriterLockSlim.ExitReadLock.
◆ Enter()
static IDisposable ExitGames.Threading.ReadLock.Enter |
( |
ReaderWriterLockSlim |
syncObject | ) |
|
|
inlinestatic |
Enters a critical section with ReaderWriterLockSlim.EnterReadLock and returns a new instance of ReadLock.
- Parameters
-
syncObject | The reader writer lock. |
- Returns
- A ReadLock that can be disposed to call ReaderWriterLockSlim.ExitReadLock.
◆ TryEnter()
static IDisposable ExitGames.Threading.ReadLock.TryEnter |
( |
ReaderWriterLockSlim |
syncObject, |
|
|
int |
millisecondsTimeout |
|
) |
| |
|
inlinestatic |
Enters a critical section with ReaderWriterLockSlim.TryEnterReadLock(int) and returns a new instance of ReadLock.
- Parameters
-
syncObject | The reader writer lock. |
millisecondsTimeout | The timeout for ReaderWriterLockSlim.TryEnterReadLock(int) in milliseconds. |
- Returns
- A WriteLock that can be disposed to call ReaderWriterLockSlim.ExitReadLock.
- Exceptions
-