Code example for Semaphore

Methods: acquirerelease

0
 
	public void send_stop() { 
		Log.d(TAG, "in send_stop()");
		queue.clear();
		try { 
			writeLock.acquire();
			Log.d(TAG, "sending feedhold");
			write("!"); 
			Log.d(TAG, "sending {\"qf\":1}");
			write("{\"qf\":1}\n"); 
		} catch (InterruptedException e) {
			e.printStackTrace();
		} 
 
		writeLock.release();
	} 
 
	public Bundle getMotor(int m) {
		return machine.getMotorBundle(m);
	} 
Stop searching for code, let great code find you!  Add Codota to your java IDE