mirror of
https://github.com/XRPLF/clio.git
synced 2026-04-29 15:37:53 +00:00
chore: Enable TSAN without ignoring errors (#2828)
This commit is contained in:
@@ -30,7 +30,6 @@
|
||||
#include <boost/asio/spawn.hpp>
|
||||
#include <boost/asio/steady_timer.hpp>
|
||||
#include <boost/asio/strand.hpp>
|
||||
#include <boost/asio/use_future.hpp>
|
||||
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
@@ -96,7 +95,12 @@ public:
|
||||
if (auto expected = State::Running; not state_.compare_exchange_strong(expected, State::Stopped))
|
||||
return; // Already stopped or not started
|
||||
|
||||
boost::asio::spawn(strand_, [this](auto&&) { timer_.cancel(); }, boost::asio::use_future).wait();
|
||||
std::binary_semaphore cancelSemaphore{0};
|
||||
boost::asio::post(strand_, [this, &cancelSemaphore]() {
|
||||
timer_.cancel();
|
||||
cancelSemaphore.release();
|
||||
});
|
||||
cancelSemaphore.acquire();
|
||||
semaphore_.acquire();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user