TFairSemaphoreSection.Enter Method

function Enter: Integer;

Enter the critical section.

Returns: Int32

Remarks:

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.