fix(net): scope GCC -Wno-tsan to Http.cpp and fix StallServer race
This commit is contained in:
1 parent
66baae74a0
commit
9920bfdaac
2 files changed
+12
-1
No files matched your search
@@ -9,3 +9,13 @@ void_add_module(Net
|
|||||||
OpenSSL::Crypto
|
OpenSSL::Crypto
|
||||||
Threads::Threads
|
Threads::Threads
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(VOID_ENABLE_TSAN AND TARGET Void_Net)
|
||||||
|
# Boost.Asio 1.84's std_fenced_block calls std::atomic_thread_fence, which
|
||||||
|
# GCC warns is unsupported under -fsanitize=thread (-Werror=tsan). Keep
|
||||||
|
# hardware fences intact and scope the diagnostic suppression solely to
|
||||||
|
# Http.cpp so HttpServer.cpp and all other TUs keep full -Werror=tsan.
|
||||||
|
set_source_files_properties("${CMAKE_CURRENT_LIST_DIR}/Http.cpp"
|
||||||
|
PROPERTIES COMPILE_OPTIONS "$<$<CXX_COMPILER_ID:GNU>:-Wno-tsan>"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
@@ -273,8 +273,9 @@ Void::Testing::Test http_client_timeout_bounds_a_stalled_server()
|
|||||||
|
|
||||||
~StallServer()
|
~StallServer()
|
||||||
{
|
{
|
||||||
if (conn >= 0) ::close(conn);
|
if (fd >= 0) ::shutdown(fd, SHUT_RDWR);
|
||||||
if (worker.joinable()) worker.join();
|
if (worker.joinable()) worker.join();
|
||||||
|
if (conn >= 0) ::close(conn);
|
||||||
if (fd >= 0) ::close(fd);
|
if (fd >= 0) ::close(fd);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user