@@ -0,0 +1,1015 @@
+package concurrent.condition;%0A%0Aimport java.util.concurrent.locks.Condition;%0Aimport java.util.concurrent.locks.ReentrantLock;%0A%0Apublic class BaseConditionTest %7B%0A%0A%09ReentrantLock lock = new ReentrantLock();%0A%09Condition condition = lock.newCondition();%0A%0A%09public void test() throws Exception %7B%0A%09%09new Thread() %7B%0A%09%09%09public void run() %7B%0A%09%09%09%09try %7B%0A%09%09%09%09%09lock.lock();%0A%09%09%09%09%09System.out.println(%22I get the lock%22);%0A%09%09%09%09%09condition.await();%0A%09%09%09%09%09System.out.println(%22I am back%22);%0A%09%09%09%09%7D catch (InterruptedException e) %7B%0A%09%09%09%09%09e.printStackTrace();%0A%09%09%09%09%7D finally %7B%0A%09%09%09%09%09lock.unlock();%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D.start();%0A%0A%09%09new Thread() %7B%0A%09%09%09public void run() %7B%0A%09%09%09%09try %7B%0A%09%09%09%09%09lock.lock();%0A%09%09%09%09%09System.out.println(%22U get the lock%22);%0A%09%09%09%09%09condition.signalAll();%0A%09%09%09%09%09Thread.sleep(3000);%0A%09%09%09%09%09System.out.println(%22U am back%22);%0A%09%09%09%09%7D catch (InterruptedException e) %7B%0A%09%09%09%09%09e.printStackTrace();%0A%09%09%09%09%7D finally %7B%0A%09%09%09%09%09lock.unlock();%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D.start();%0A%09%7D%0A%0A%09public static void main(String%5B%5D args) throws Exception %7B%0A%09%09new BaseConditionTest().test();%0A%09%7D%0A%7D%0A

add code