Index: lib/xray/xray_fdr_logging.cc =================================================================== --- lib/xray/xray_fdr_logging.cc +++ lib/xray/xray_fdr_logging.cc @@ -59,7 +59,7 @@ size_t OptionsSize) XRAY_NEVER_INSTRUMENT { assert(OptionsSize == sizeof(FDRLoggingOptions)); XRayLogInitStatus CurrentStatus = XRayLogInitStatus::XRAY_LOG_UNINITIALIZED; - if (!LoggingStatus.compare_exchange_weak( + if (!LoggingStatus.compare_exchange_strong( CurrentStatus, XRayLogInitStatus::XRAY_LOG_INITIALIZING, std::memory_order_release, std::memory_order_relaxed)) return CurrentStatus; @@ -91,7 +91,7 @@ return XRayLogFlushStatus::XRAY_LOG_NOT_FLUSHING; XRayLogFlushStatus Result = XRayLogFlushStatus::XRAY_LOG_NOT_FLUSHING; - if (!LogFlushStatus.compare_exchange_weak( + if (!LogFlushStatus.compare_exchange_strong( Result, XRayLogFlushStatus::XRAY_LOG_FLUSHING, std::memory_order_release, std::memory_order_relaxed)) return Result; @@ -143,7 +143,7 @@ XRayLogInitStatus FDRLogging_finalize() XRAY_NEVER_INSTRUMENT { XRayLogInitStatus CurrentStatus = XRayLogInitStatus::XRAY_LOG_INITIALIZED; - if (!LoggingStatus.compare_exchange_weak( + if (!LoggingStatus.compare_exchange_strong( CurrentStatus, XRayLogInitStatus::XRAY_LOG_FINALIZING, std::memory_order_release, std::memory_order_relaxed)) return CurrentStatus; @@ -159,7 +159,7 @@ XRayLogInitStatus FDRLogging_reset() XRAY_NEVER_INSTRUMENT { XRayLogInitStatus CurrentStatus = XRayLogInitStatus::XRAY_LOG_FINALIZED; - if (!LoggingStatus.compare_exchange_weak( + if (!LoggingStatus.compare_exchange_strong( CurrentStatus, XRayLogInitStatus::XRAY_LOG_UNINITIALIZED, std::memory_order_release, std::memory_order_relaxed)) return CurrentStatus;