Lab2/src/main/java/synchronisedFix/Task.java
/**
     * run's 500 tasks with sleep between 100
     */
run's 500 tasks with sleep between 100
run ' s 500 tasks with sleep between 100
public void run()
    {
        try
        {
            for (int i = 0; i<500; i++)
            {
                total.inc();
                if (i%100==0){
                   Thread.sleep(100); 
                }
                        System.out.println("thread is running "+Thread.currentThread().getName());
            }
        }
        catch(InterruptedException e)
        {
            e.printStackTrace();
        }
    }
public void run ( ) { try { for ( int i = 0 ; i < 500 ; i ++ ) { total . inc ( ) ; if ( i % 100 == 0 ) { Thread . sleep ( 100 ) ; } System . out . println ( "thread is running " + Thread . currentThread ( ) . getName ( ) ) ; } } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } }
run's 500 tasks with sleep between 100
run ' s 500 tasks with sleep between 100