@@ -22,13 +22,15 @@
#include "network_udp.h"
#include "network_gamelist.h"
#include "../newgrf_text.h"
NetworkGameList *_network_game_list = NULL;
/** Mutex for handling delayed insertion/querying of servers. */
static ThreadMutex *_network_game_list_mutex = ThreadMutex::New();
/** The games to insert when the GUI thread has time for us. */
static NetworkGameList *_network_game_delayed_insertion_list = NULL;
/**
* Add a new item to the linked gamelist, but do it delayed in the next tick
* or so to prevent race conditions.
* @param item the item to add. Will be freed once added.
@@ -69,13 +71,12 @@ static void NetworkGameListHandleDelayed
}
* Add a new item to the linked gamelist. If the IP and Port match
* return the existing item instead of adding it again
* @param address the address of the to-be added item
* @param port the port the server is running on
* @return a point to the newly added or already existing item
*/
NetworkGameList *NetworkGameListAddItem(NetworkAddress address)
{
const char *hostname = address.GetHostname();