FIFO code explanation
<p>Is the following code an example of a FIFO ordering?</p>

<p>The problem consists of implementing a FIFO queue.</p>

<p>In a nutshell: a random number of cars (going north or south) drive along a two lane road.
They must traverse a bridge which is one way.</p>

<p>The bridge access is dependent on the arrival time. First come First served.</p>

<p>Can I say that through this statement</p>

<pre><code>semaphore = new Semaphore(capacita,true); 
</code></pre>

<p>cars cross the bridge according their arrival order?</p>

<p>Here I can't figure out how it works and how it can be related to the previous statement</p>

<pre><code>lock = new ReentrantLock(true); 
</code></pre>

<p>Can someone help me?</p>

<p>thanks </p>

<pre><code>public Ponte(int capacita){
        nNordTraversing = 0;    
        nSudTraversing = 0;     
        nNordWaiting = 0;   
        nSudWaiting = 0;    

        semaphore = new Semaphore(capacita,true); 


        lock = new ReentrantLock(true);           

        waitingCond = lock.newCondition();
        bridgeCond = lock.newCondition();
    }
</code></pre>
