import java.util.concurrent.locks.*;

class JSR166 {
	Lock l = new ReentrantLock();
	int x;

	void l() {
		l.lock();
		}

	void foo() {
		l.lock();
		x++;
		if (x >= 0) 
			l.unlock();
		}

	void increment() {
		l.lock();
		x++;
		l.unlock();
		}

	void decrement() {
		l.lock();
		try {
		  x++;
		} finally {
		  l.unlock();
		  }
		}
	}



	
	

import java.util.concurrent.locks.*;

class JSR166 {
	Lock l = new ReentrantLock();
	int x;

	void l() {
		l.lock();
		}

	void foo() {
		l.lock();
		x++;
		if (x >= 0) 
			l.unlock();
		}

	void increment() {
		l.lock();
		x++;
		l.unlock();
		}

	void decrement() {
		l.lock();
		try {
		  x++;
		} finally {
		  l.unlock();
		  }
		}
	
	
	void waitOnCondition(Condition cond) throws InterruptedException {
		while (x == 0) {
		cond.wait();
		cond.wait(1000L);
		cond.wait(1000L, 10);
		}
	}
	}

Call wait() on a Condition.
Call wait() on a Condition.


git-svn-id: e7d6bde23f017c9ff4efd468d79d66def666766b@3997 eae3c2d3-9b19-0410-a86e-396b6ccb6ab3
