lab3/src/main/java/com/mycompany/lab3/Task.java
/**
     * all threads runs before barrier first
     * and then goes through barrier
     * and runs after barrier
     */
all threads runs before barrier first
and then goes through barrier
and runs after barrier
all threads runs before barrier first and then goes through barrier and runs after barrier
public void run()
    {
        for (int i = 0; i < 2; i++) {
           System.out.println("before barrier vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv");
           barrier.arrival();
           System.out.println("after barrier ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
        }
    }
public void run ( ) { for ( int i = 0 ; i < 2 ; i ++ ) { System . out . println ( "before barrier vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv" ) ; barrier . arrival ( ) ; System . out . println ( "after barrier ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" ) ; } }
all threads runs before barrier first
 and then goes through barrier
 and runs after barrier
all threads runs before barrier first and then goes through barrier and runs after barrier