package moleque;

public class ThreadControl
{
    public static void main(String[] args)
    {
        ThreadAdd thr1 = new ThreadAdd(2,3);
        ThreadSub thr2 = new ThreadSub(2,3);
        ThreadMult thr3 = new ThreadMult(2,2,1);

        thr1.start();
        thr2.start();
        thr3.start();
    }
}

@@ -11,16 +11,56 @@
 leque;%0A%0A
+import java.util.concurrent.Semaphore;%0A%0A
 public c
@@ -129,16 +129,145 @@
 )%0A    %7B%0A
+        Semaphore sem1 = new Semaphore(1),%0A                  sem2 = new Semaphore(1),%0A                  sem3 = new Sempahore(1);%0A
         
@@ -296,24 +296,30 @@
 hreadAdd(2,3
+, sem1
 );%0A        T
@@ -351,16 +351,28 @@
 dSub(2,3
+, sem1, sem2
 );%0A     
@@ -412,16 +412,80 @@
 lt(2,2,1
+, sem2, sem3);%0A        ThreadDiv thr4 = new ThreadDiv(6, 2, sem3
 );%0A%0A    

Add semaphores