diff --git a/SilKit/source/services/orchestration/LifecycleService.hpp b/SilKit/source/services/orchestration/LifecycleService.hpp index 7390c2afd..8b7d2087a 100644 --- a/SilKit/source/services/orchestration/LifecycleService.hpp +++ b/SilKit/source/services/orchestration/LifecycleService.hpp @@ -148,7 +148,6 @@ class LifecycleService std::atomic _timeSyncActive{false}; // Final State Handling - std::mutex _finalStatePromiseMutex; std::unique_ptr> _finalStatePromise; std::future _finalStateFuture; diff --git a/SilKit/source/services/orchestration/TimeSyncService.hpp b/SilKit/source/services/orchestration/TimeSyncService.hpp index 2d87cb2d7..e62bb31e4 100644 --- a/SilKit/source/services/orchestration/TimeSyncService.hpp +++ b/SilKit/source/services/orchestration/TimeSyncService.hpp @@ -159,7 +159,6 @@ class TimeSyncService WatchDog _watchDog; bool _isCoupledToWallClock{false}; std::thread _wallClockCouplingThread; - mutable std::mutex _mx; std::atomic _currentWallClockSyncPointNs{0}; double _animationFactor{0}; std::atomic _wallClockCouplingThreadRunning{false}; diff --git a/SilKit/source/tracing/PcapSink.cpp b/SilKit/source/tracing/PcapSink.cpp index 98bd2fef3..ba39fa228 100644 --- a/SilKit/source/tracing/PcapSink.cpp +++ b/SilKit/source/tracing/PcapSink.cpp @@ -40,6 +40,8 @@ void PcapSink::Open(SinkType outputType, const std::string& outputPath) throw SilKitError("PcapSink::Open: outputPath must not be empty!"); } + std::unique_lock lock{_lock}; + switch (outputType) { case SilKit::SinkType::PcapFile: @@ -73,6 +75,8 @@ auto PcapSink::Name() const -> const std::string& void PcapSink::Close() { + std::unique_lock lock{_lock}; + if (_file) { _file.flush(); @@ -107,7 +111,7 @@ void PcapSink::Trace(SilKit::Services::TransmitDirection /*unused*/, } const auto& message = traceMessage.Get(); - std::unique_lock lock; + std::unique_lock lock{_lock}; const auto tosec = 1000'000ull; const auto usec = std::chrono::duration_cast(timestamp);