Code example for Semaphore

Methods: acquire

    public void startConnection(ConnectionMessage setup, MessageHandler handler, int downlinkPort) {
	this.characterConnectionKeeper = new CharacterConnectionKeeper();
	Semaphore synchronizer = new Semaphore(0);
	characterConnectionClient = new CharacterConnectionClient(synchronizer, setup, handler, characterConnectionKeeper, downlinkPort);
	try { 
	} catch (InterruptedException ex) {
	    System.err.println("Interrupted while waiting for characterconnectionclient to start:\n"+ex);
    public void startConnection(ConnectionMessage setup, MessageHandlerProvider handlerProvider, String connectionTag, int downlinkPort){
	this.characterConnectionKeeper = new CharacterConnectionKeeper();
Connect your IDE to all the code out there  Get Codota for Java