import java.util.concurrent.locks.*; class Main { static Lock lock; static double[] sharedData; static int SD = 100, CS = 100, TH = 10; // SD: shared data srray size // CS: critical section executed per thread // TH: number of threads // Critical section updated shared data // with a random value. If all values // dont match then it was not executed // atomically! static void criticalSection() { try { double v = Math.random(); for(int i=0; i { for(int i=0; i