diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-06-06 16:41:02 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-06-06 16:41:02 +0300 |
commit | c2410ceb844a443caf6dd8c6df976b9e24724d06 (patch) | |
tree | 1cdea79c5520b79130dedb3ee829ee6f5654de6f | |
parent | 17cfa52d380673eaec3d428383b163ca4eb83f04 (diff) |
refactor: Replace RecursiveMutex with Mutex in timedata.cpp
-rw-r--r-- | src/timedata.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/timedata.cpp b/src/timedata.cpp index dd56acf44f..721e3f7a79 100644 --- a/src/timedata.cpp +++ b/src/timedata.cpp @@ -16,8 +16,8 @@ #include <warnings.h> -static RecursiveMutex cs_nTimeOffset; -static int64_t nTimeOffset GUARDED_BY(cs_nTimeOffset) = 0; +static Mutex g_timeoffset_mutex; +static int64_t nTimeOffset GUARDED_BY(g_timeoffset_mutex) = 0; /** * "Never go to sea with two chronometers; take one or three." @@ -28,7 +28,7 @@ static int64_t nTimeOffset GUARDED_BY(cs_nTimeOffset) = 0; */ int64_t GetTimeOffset() { - LOCK(cs_nTimeOffset); + LOCK(g_timeoffset_mutex); return nTimeOffset; } @@ -46,7 +46,7 @@ static int64_t abs64(int64_t n) void AddTimeData(const CNetAddr& ip, int64_t nOffsetSample) { - LOCK(cs_nTimeOffset); + LOCK(g_timeoffset_mutex); // Ignore duplicates static std::set<CNetAddr> setKnown; if (setKnown.size() == BITCOIN_TIMEDATA_MAX_SAMPLES) |