lab5/src/main/java/com/mycompany/lab5/DanceFloor.java
/**
         * @param name - name of the task, Leader with number
         * 
         */
@param name - name of the task, Leader with number
@param name - name of the task Leader with number
public void leaderDance(String name){
            try {
                mutex.acquire();
            if(followers>0){
                followers--;
                followerQ.release();
            }
            else{
                leaders++;
                mutex.release();
                leaderQ.acquire();
            }
            System.out.println("A "+name);
            rendezvous.acquire();
            mutex.release();
            } catch (InterruptedException ex) {
                System.out.println(ex.toString());
            }
        }
public void leaderDance ( String name ) { try { mutex . acquire ( ) ; if ( followers > 0 ) { followers -- ; followerQ . release ( ) ; } else { leaders ++ ; mutex . release ( ) ; leaderQ . acquire ( ) ; } System . out . println ( "A " + name ) ; rendezvous . acquire ( ) ; mutex . release ( ) ; } catch ( InterruptedException ex ) { System . out . println ( ex . toString ( ) ) ; } }
@param name - name of the task, Leader with number
@param name - name of the task Leader with number