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