diff --git a/wpinet/src/main/native/thirdparty/tcpsockets/cpp/TCPConnector_parallel.cpp b/wpinet/src/main/native/thirdparty/tcpsockets/cpp/TCPConnector_parallel.cpp index 1d979cb484..32654e90eb 100644 --- a/wpinet/src/main/native/thirdparty/tcpsockets/cpp/TCPConnector_parallel.cpp +++ b/wpinet/src/main/native/thirdparty/tcpsockets/cpp/TCPConnector_parallel.cpp @@ -15,14 +15,6 @@ using namespace wpi; -// MSVC < 1900 doesn't have support for thread_local -#if !defined(_MSC_VER) || _MSC_VER >= 1900 -// clang check for availability of thread_local -#if !defined(__has_feature) || __has_feature(cxx_thread_local) -#define HAVE_THREAD_LOCAL -#endif -#endif - std::unique_ptr TCPConnector::connect_parallel( std::span> servers, Logger& logger, int timeout) { @@ -33,18 +25,10 @@ std::unique_ptr TCPConnector::connect_parallel( // structure to make sure we don't start duplicate workers struct GlobalState { wpi::mutex mtx; -#ifdef HAVE_THREAD_LOCAL - SmallSet, 16> active; -#else SmallSet, 16> active; -#endif }; -#ifdef HAVE_THREAD_LOCAL - thread_local auto global = std::make_shared(); -#else static auto global = std::make_shared(); auto this_id = std::this_thread::get_id(); -#endif auto local = global; // copy to an automatic variable for lambda capture // structure shared between threads and this function @@ -63,12 +47,8 @@ std::unique_ptr TCPConnector::connect_parallel( for (const auto& server : servers) { std::pair server_copy{std::string{server.first}, server.second}; -#ifdef HAVE_THREAD_LOCAL - const auto& active_tracker = server_copy; -#else std::tuple active_tracker{ this_id, server_copy.first, server_copy.second}; -#endif // don't start a new worker if we had a previously still-active connection // attempt to the same server