From 2af0119452c5a367885633a53215e717e166916d Mon Sep 17 00:00:00 2001 From: t-horikawa Date: Thu, 16 May 2024 09:33:42 +0900 Subject: [PATCH] fix a race that occurs within server_mock used in testing --- test/tateyama/test_utils/endpoint.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/tateyama/test_utils/endpoint.h b/test/tateyama/test_utils/endpoint.h index 77f7756..5275b30 100644 --- a/test/tateyama/test_utils/endpoint.h +++ b/test/tateyama/test_utils/endpoint.h @@ -146,7 +146,8 @@ class endpoint { }; endpoint(const std::string& name, const std::string& digest, boost::barrier& sync) - : name_(name), digest_(digest), container_(std::make_unique(name_, 1)), thread_(std::thread(std::ref(*this))), sync_(sync) { + : name_(name), digest_(digest), container_(std::make_unique(name_, 1)), sync_(sync) { + thread_ = std::thread(std::ref(*this)); } ~endpoint() { if (thread_.joinable()) {