C# Class Opc.Ua.SafeLock

A class that allows threads to determine who, if anyone, has the lock on an object.
Datei anzeigen Open project: OPCFoundation/Misc-Tools Class Usage Examples

Public Methods

Method Description
Enter ( ) : void

Acquires the lock.

Exit ( ) : void

Releases the lock.

HasLock ( ) : bool

Checks if the current thread has acquired the lock.

TryEnter ( int timeout ) : bool

Attempts to acquire the lock.

Method Details

Enter() public method

Acquires the lock.
Thrown if the lock state is inconsistent.
public Enter ( ) : void
return void

Exit() public method

Releases the lock.
Thrown if the lock state is inconsistent.
public Exit ( ) : void
return void

HasLock() public method

Checks if the current thread has acquired the lock.
public HasLock ( ) : bool
return bool

TryEnter() public method

Attempts to acquire the lock.
Thrown if the lock state is inconsistent.
public TryEnter ( int timeout ) : bool
timeout int The number of milliseconds to wait.
return bool