Should i use lock.lock(): in this method?
<p>I wrote this method whose purpose is to give notice of the fact that a thread is leaving a</p>

<p>specific block of code </p>

<p>A thread stands for a car which is leaving a bridge so other cars can traverse it . </p>

<p>The bridge is accessible to a given number of cars (limited capacity) and it's one way only.</p>

<pre><code>public void getout(int diection){
        // release the lock
        semaphore.release();

        try{
            lock.lock(); //access to shared data
            if(direction == Car.NORTH)
                nNordTraversing--; //decreasing traversing threads
            else
                nSudTraversing--;

            bridgeCond.signal(); 

        }finally{
            lock.unlock();
        }

    }
</code></pre>

<p>My question is: should I use lock.lock(); or it's just nonsense?</p>

<p>thanks in advance</p>
