allow the package server ping thread to take ages

Don't have the main thread wait for the ping thread, because the ping
thread may take a long time to respond - when a server connection can't
be established. Sadly, there's no timeout for "connect()".
This commit is contained in:
ac-stef
2015-09-14 16:03:09 +02:00
parent 5a4b605b33
commit f424c95a7f
+5 -1
View File
@@ -430,7 +430,11 @@ int downloadpackages(bool loadscr) // get all pending packages
httpget h;
canceldownloads = false;
progress_of = loadscr ? pendingpackages.length() : -1;
sem_pckservers.wait();
if(sem_pckservers.trywait())
{ // can't lock the server list -> this means, the server ping threads have not finished yet
if(pendingpackages.length()) conoutf("\f3failed to download packages: still pinging the servers...");
return 0;
}
pckservers.sort(pckserversort);
loopv(pendingpackages)
{