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