JCL Help:TJclThreadPersistent.Lock

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Prevents other threads from acessing the object.


Pascal

 public procedure Lock;


Description

Blocks other execution threads from locking the object until the Unlock method is called. If another thread tryes to call the Lock method of an object which is already locked, its execution will be stalled until the lock is released with Unlock method.
Once a thread has locked the object, it can make additional calls to Lock method without blocking its own execution. This prevents the thread from deadlocking itself while waiting for releasing of a lock that it already owns. LockCount is increased each time Lock is called.


About

Donator

Alex Denissov


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page