Code example for ReentrantReadWriteLock

Methods: readLockwriteLock

package warGem; 
import java.awt.AWTException; 
import java.awt.Point; 
import java.awt.Robot; 
import java.util.concurrent.locks.Lock; 
import java.util.concurrent.locks.ReentrantReadWriteLock; 
public class mouseHandle { 
	private ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
	private Lock readLock = lock.readLock();
	private Lock writeLock = lock.writeLock();
	private Robot reseter;
	public mouseHandle() { 
		try { 
			reseter = new Robot();
		} catch (AWTException e) {
			// TODO Auto-generated catch block 
	public void resetMousePosition() { 
Connect your IDE to all the code out there  Get Codota for Java