JCL Help:TJclMeteredSection.Enter

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Enters the metered section.


Pascal

 public function Enter(TimeOut: Longword): TJclWaitResult;


Parameters

Parameters Description
TimeOut: Longword Specifies the time-out interval, in milliseconds. The function returns if the interval elapses, even if the metered section does not have an open slot. If Milliseconds is zero, the function tests the metered section's state a and returns immediately. If Milliseconds is INFINITE, the function's time-out interval never elapses.


Return Value

If access was granted the result is wrSignaled, if the specified TimeOut elapsed the result is wrTimeOut and if an error occured the result is wrError. Although TJclWaitResult includes other values, these should never be encountered as the function result.


Description

The Enter method decreases the count of the metered section object thereby granting access to the protected resource to a single thread. The method does not return until either access was granted, the specified timeout elapses or an error occurs.


About

Donator

Marcel van Brakel


Notes

The EnterMeteredSection function checks for an available slot in the metered section. If the metered section does not have an available slot, the calling thread enters an efficient wait state. The thread consumes very little processor time while waiting for a slot to become free.


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