Examples of ConcurrentSkipListSet


Examples of java.util.concurrent.ConcurrentSkipListSet

    private Collection<LobbySession> getPlayers(int gameTypeId) {
        // add to new list
        Collection<LobbySession> players = gameTypeRooms.get(gameTypeId);
        if (players==null) {
            // we need to use something Concurrent or we will get ConcurrentModificationException
            gameTypeRooms.putIfAbsent(gameTypeId, new ConcurrentSkipListSet() );
            players = gameTypeRooms.get(gameTypeId);
        }
        return players;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.