Code example for Lock

Methods: newCondition

0
	private final BluetoothSocket socket;
	private final String destinationAddress;
	private boolean running = true;
	private Message ackWaitingMessage = null;
	private Lock ackLock = new ReentrantLock(true);
	private Condition ackReceivedCondition = ackLock.newCondition();
	private NetworkListener networkListener;
	private BluetoothAdapter bluetoothAdapter;
	 
	public BluetoothSocketHandler(BluetoothSocket socket) {
		super(); 
		this.socket = socket;
		this.destinationAddress = socket.getRemoteDevice().getAddress();
		this.bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
		setName("BluetoothSocketHandler_"+socket.getRemoteDevice().getAddress());
	} 
	 
	 
	public void setNetworkListener(NetworkListener networkListener) {
		this.networkListener = networkListener;
	}