Code example for ReadWriteLock

Methods: readLock

0
 
    @Override 
    protected ServerInfo getStoredServer(ProxiedPlayer player)
    { 
        ServerInfo server = null;
        lock.readLock().lock();
        try 
        { 
            server = ProxyServer.getInstance().getServerInfo( data.get( key( player ) ) );
        } finally 
        { 
            lock.readLock().unlock();
        } 
        return server;
    } 
 
    @Override 
    public void setServer(ProxiedPlayer player)
    { 
        lock.writeLock().lock();
Contextual code suggestions in your IDE  Get Codota for Java