SyncScope
Ecng.Common
A lightweight synchronization scope that enters a lock on construction and exits on dispose.
构造函数
SyncScope
public SyncScope(Lock lock)
syncScope = SyncScope(lock)
Creates a new synchronization scope and enters the provided Lock.
- lock
- The typed Lock to enter.
SyncScope
public SyncScope(object syncRoot)
syncScope = SyncScope(syncRoot)
Initializes a new synchronization scope and enters the provided synchronization object.
- syncRoot
- Synchronization object. If it's a Lock, EnterScope is used; otherwise, Object) is used.