JCL Help:TJclOptex.Enter

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Enters the Optex.


Pascal

 public procedure Enter;


Description

Enter attempts to get access to the optex, this is referred to as acquiring ownership of the optex. Only one thread can own the optex at any time. If the optex is currently owned by a different thread the function blocks until the critical section becomes free. After acquiring ownership of the optex you must release it as soon as you are done with it by calling the Leave method. Although only one thread can own the optex, a single thread can own the optex 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. Note that if the process is running on a multiprocessor system and the optex is currently owned by anther thread, the Enter method spins in a loop SpinCount number of times, trying to acquire the optex. If the optex becomes available before the loop terminated the thread acquires the optex and returns. On a single-processor system the method only tries one time.


About

Donator

Marcel van Brakel


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