JVCL Help:TJvMTSection.AllowRecursion

From Project JEDI Wiki
Jump to navigationJump to search
JEDI Visual Component Library Help

Search in JVCL Help

 
Search in all projects
 

Summary

Specifies whether calls to Enter are allowed within a critical section.


Pascal

 propertyAllowRecursion: Boolean;


Description

When the Enter method is called multiple time by the same thread this option determines if a 2nd call blocks or succeeds.
If AllowRecursion is set to true, then an Enter call from a specific thread within the critical section will succeed immediately, otherwise it would block indefinitely.
JvMTSection1.AllowRecursion := True;
JvMTSection1.Enter;
// begin of critical section

// next call will succeed immediately
JvMTSection1.Enter;
JvMTSection1.Leave;

// next call leaves the critical section
JvMTSection1.Leave;


About

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