RAD Studio |  |

Locking Objects
See Also
Collapse All

Some objects have built-in locking that prevents the execution of other threads from using that object instance.

For example, canvas objects (TCanvas and descendants) have a Lock method that prevents other threads from accessing the canvas until the Unlock method is called.

VCL applications also include a thread-safe list object, TThreadList. Calling LockList returns the list object while also blocking other execution threads from using the list until the UnlockList method is called. Calls to TCanvas.Lock or TThreadList.LockList can be safely nested. The lock is not released until the last locking call is matched with a corresponding unlock call in the same thread.

See Also

Using Critical Sections

Using the Main VCL Thread

Using the Multi-read Exclusive-write Synchronizer

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!