Code example for Lock

Methods: lockunlock

0
  } 
 
  @Override 
  public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception
  { 
    _msgLock.lock();
    try 
    { 
      _messages.add(e.getMessage());
      _newMsgCondition.signalAll();
    } 
    finally 
    { 
      _msgLock.unlock();
    } 
    super.messageReceived(ctx, e);
  } 
 
} 
Contextual code suggestions in your IDE  Get Codota for Java