Explicitly use std::launch::async

This commit is contained in:
Ted John 2019-05-07 09:00:23 +01:00
parent 6e6fe3c3c1
commit 3334d40da4
2 changed files with 3 additions and 3 deletions

View File

@ -545,7 +545,7 @@ static void server_list_fetch_servers_begin()
_serverList.ReadAndAddFavourites();
_statusText = STR_SERVER_LIST_CONNECTING;
_fetchFuture = std::async([] {
_fetchFuture = std::async(std::launch::async, [] {
// Spin off background fetches
auto lanF = _serverList.FetchLocalServerListAsync();
auto wanF = _serverList.FetchOnlineServerListAsync();

View File

@ -237,7 +237,7 @@ bool ServerList::WriteFavourites(const std::vector<ServerListEntry>& entries)
std::future<std::vector<ServerListEntry>> ServerList::FetchLocalServerListAsync(const INetworkEndpoint& broadcastEndpoint)
{
auto broadcastAddress = broadcastEndpoint.GetHostname();
return std::async([broadcastAddress] {
return std::async(std::launch::async, [broadcastAddress] {
constexpr auto RECV_DELAY_MS = 10;
constexpr auto RECV_WAIT_MS = 2000;
@ -287,7 +287,7 @@ std::future<std::vector<ServerListEntry>> ServerList::FetchLocalServerListAsync(
std::future<std::vector<ServerListEntry>> ServerList::FetchLocalServerListAsync()
{
return std::async([&] {
return std::async(std::launch::async, [&] {
// Get all possible LAN broadcast addresses
auto broadcastEndpoints = GetBroadcastAddresses();