Ported AC to SDL2

This commit is contained in:
Jani-Markus Maunus
2018-02-10 11:28:48 +01:00
committed by aurhat
parent 9f537b0876
commit f86579533a
119 changed files with 33154 additions and 10826 deletions
+7 -4
View File
@@ -74,7 +74,7 @@ void resolverinit()
resolverthread &rt = resolverthreads.add();
rt.query = NULL;
rt.starttime = 0;
rt.thread = SDL_CreateThread(resolverloop, &rt);
rt.thread = SDL_CreateThread(resolverloop, "ResolverThread", &rt);
}
SDL_UnlockMutex(resolvermutex);
}
@@ -85,9 +85,12 @@ void resolverstop(resolverthread &rt)
if(rt.query)
{
#ifndef __APPLE__
SDL_KillThread(rt.thread);
// FIXME SDL2: implement a replacement for this if necessary
// Looks like the resolver thread should bail whenever
// a new one is created anyway, no idea why this was ever necessary.
//SDL_KillThread(rt.thread);
#endif
rt.thread = SDL_CreateThread(resolverloop, &rt);
rt.thread = SDL_CreateThread(resolverloop, "ResolverThread", &rt);
}
rt.query = NULL;
rt.starttime = 0;
@@ -252,7 +255,7 @@ int connectwithtimeout(ENetSocket sock, const char *hostname, ENetAddress &addre
if(!conncond) conncond = SDL_CreateCond();
SDL_LockMutex(connmutex);
connectdata cd = { sock, address, -1 };
connthread = SDL_CreateThread(connectthread, &cd);
connthread = SDL_CreateThread(connectthread, "ConnectThread", &cd);
int starttime = SDL_GetTicks(), timeout = 0;
for(;;)