It builds a queue of waiting threads to acquire the Semaphore. This makes it quite a bit slower, but permits will be given in the order the threads were added to the queue.
Note: due to the race conditions which can occur in multiple threads, you cannot say that the thread which attempts to acquire the Semaphore will be added to the queue first e.g. if it pauses between trying to acquire the Semaphore and being added to the queue.