You are here: Symbol Reference > Math387 Namespace > Classes > TFairSemaphoreSection Class > public > TFairSemaphoreSection.Enter Method
MtxVec VCL
ContentsIndex
PreviousUpNext
TFairSemaphoreSection.Enter Method

Enter the critical section.

Pascal
function Enter: integer;

Guarantees the sequence of threads that pass through, to match the order in which they called Enter. The function will return the index of the free shared resource. The index will start at 0 and end at Count - 1 and is guaranteed to be unusued by any thread currently executing within the critical section. 

The Count property of this class specifies the number of threads that can enter the semaphored critical section concurrently. 

Call "Leave" before calling "Enter" on the same critical section by the same thread again.

Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!