today i found a pretty funny issue. Basically this code doesnt work if you remove the System.out.println. It never goes inside the if without it !!! (Thread is started from main class)
import java.util.LinkedList;
import java.util.Vector;
import java.util.Queue;
public class Matchmaking extends Thread{
public static Vector onlinePlayers = new Vector();
public static Queue<Player> queuedPlayers = new LinkedList<Player>();
@Override
public void run() {
while(true){
System.out.println(queuedPlayers.size());
if(queuedPlayers.size() >= 2){
new Matchmaking_GameFoundThreads(queuedPlayers.remove(),queuedPlayers.remove());
}
}
}
}