JCL Help:TJclCriticalSection.Enter

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Enters the critical section.


Pascal

 public procedure Enter;


Description

Enter attempts to get access to the critical section, this is referred to as acquiring ownership of the critical section. Only one thread can own the critical section at any time. If the critical section is currently owned by a different thread the function blocks until the critical section becomes free. After acquiring ownership of the critical section you must release it as soon as you are done with it by calling the Leave method. Although only one thread can own the critical section, a single thread can own the critical section more than once. This means you can call Enter multiple times. However, calls to Enter and Leave must be balanced: you must call Leave for each time you call Enter.


See Also

Leave


About

Donator

Marcel van Brakel


Notes

In extremely low-memory situations a call to Enter may fail by raising an exception. If you cannot tolerate a failure of Enter you should use TJclCriticalSectionEx instead.


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