C# Class Opc.Ua.SafeLock

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

Méthodes publiques

Méthode 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 méthode

Acquires the lock.
Thrown if the lock state is inconsistent.
public Enter ( ) : void
Résultat void

Exit() public méthode

Releases the lock.
Thrown if the lock state is inconsistent.
public Exit ( ) : void
Résultat void

HasLock() public méthode

Checks if the current thread has acquired the lock.
public HasLock ( ) : bool
Résultat bool

TryEnter() public méthode

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.
Résultat bool