Index: src/liblogger/TLoggerRotationInfo.cpp =================================================================== diff -u -N -r12b36349f6214befeace08efa9acc7e03be0d847 -r8f634460db3f225ca24f2e447b3730d4f0614166 --- src/liblogger/TLoggerRotationInfo.cpp (.../TLoggerRotationInfo.cpp) (revision 12b36349f6214befeace08efa9acc7e03be0d847) +++ src/liblogger/TLoggerRotationInfo.cpp (.../TLoggerRotationInfo.cpp) (revision 8f634460db3f225ca24f2e447b3730d4f0614166) @@ -18,43 +18,36 @@ // ============================================================================ #include "stdafx.h" #include "TLoggerRotationInfo.h" -#include namespace logger { TLoggerRotationInfo::TLoggerRotationInfo() { } - TLoggerRotationInfo::TLoggerRotationInfo(unsigned long long ullMaxLogSize, unsigned long ulMaxRotatedCount) : - m_ullMaxLogSize(ullMaxLogSize), - m_ulMaxRotatedCount(ulMaxRotatedCount) + TLoggerRotationInfo::TLoggerRotationInfo(unsigned int uiMaxLogSize, unsigned int uiMaxRotatedCount) : + m_uiMaxLogSize(uiMaxLogSize), + m_uiMaxRotatedCount(uiMaxRotatedCount) { } - void TLoggerRotationInfo::SetRotationInfo(unsigned long long ullMaxLogSize, unsigned long ulMaxRotatedCount) + void TLoggerRotationInfo::SetMaxLogSize(unsigned int uiMaxLogSize) { - boost::unique_lock lock(m_mutex); - m_ullMaxLogSize = ullMaxLogSize; - m_ulMaxRotatedCount = ulMaxRotatedCount; + InterlockedExchange(&m_uiMaxLogSize, uiMaxLogSize); } - void TLoggerRotationInfo::GetRotationInfo(unsigned long long& ullMaxLogSize, unsigned long& ulMaxRotatedCount) const + void TLoggerRotationInfo::SetRotatedCount(unsigned int uiMaxRotatedCount) { - boost::shared_lock lock(m_mutex); - ullMaxLogSize = m_ullMaxLogSize; - ulMaxRotatedCount = m_ulMaxRotatedCount; + InterlockedExchange(&m_uiMaxRotatedCount, uiMaxRotatedCount); } - unsigned long long TLoggerRotationInfo::GetMaxLogSize() const + unsigned int TLoggerRotationInfo::GetMaxLogSize() const { - boost::shared_lock lock(m_mutex); - return m_ullMaxLogSize; + return InterlockedCompareExchange(&m_uiMaxLogSize, 0, 0); } - unsigned long TLoggerRotationInfo::GetMaxRotatedCount() const + unsigned int TLoggerRotationInfo::GetMaxRotatedCount() const { - boost::shared_lock lock(m_mutex); - return m_ulMaxRotatedCount; + return InterlockedCompareExchange(&m_uiMaxRotatedCount, 0, 0); } }