Lock Record

Provides an easy to use wrapper around TCriticalSection. It automatically initializes the TCriticalSection instance when required and destroys it when the Lock goes out of scope.

Namespace: Spring
type
 Lock = record
 end;

The Lock type exposes the following members.

Show:
 NameDescription
EnsureInitialized

Represents method EnsureInitialized.

Enter

Calls Enter on the underlying TCriticalSection. The first call also initializes the TCriticalSection instance.

Leave

Calls Leave on the underlying TCriticalSection. If no call to Enter has been made before it will raise an exception.

ScopedLock

Calls Enter on the underlying TCriticalSection and returns an interface reference that will call Leave once it goes out of scope.

Top
Show:
 NameDescription
fCriticalSection

Represents field fCriticalSection.

Top