TLazMonitor.Acquire procedure
Limits thread access to the calling thread.
Declaration
procedure Acquire; overrideDescription
Acquire is an overridden procedure used to limit threaded access
to resources to the current calling thread. Acquire extends the inherited
method to use a spinlock (or busy waiting loop) to get mutually exclusive
access to resources shared between threads.
The SpinLock processing loop waits for successful completion of the
Enter/Acquire method, but yields CPU cycles by calling sleep() to
allow other threads to execute periodically. The internal yield/sleep
thresholds are artificially low (10ms - 20ms) to avoid process
scheduler/context switching conflicts for executing threads.
The inherited Acquire method is called when the method has
successfully blocked access to other threads by entering the critical section.
Use the SpinCount property to determine the maximum number of
iterations for the spinlock processing cycle. Use DefaultSpinCount
to determine the default value used for the SpinCount property in new
instances of the class.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
