Fix data race condition in BanMan::DumpBanlist()
The m_is_dirty value being read in BannedSetIsDirty() can differ from the value being set in SweepBanned(), i.e., be inconsistent with a BanMan instance internal state.
This commit is contained in:
1 file changed
+5
-3
+5
-3
@@ -43,9 +43,11 @@ void BanMan::DumpBanlist()
|
|||||||
static Mutex dump_mutex;
|
static Mutex dump_mutex;
|
||||||
LOCK(dump_mutex);
|
LOCK(dump_mutex);
|
||||||
|
|
||||||
SweepBanned(); // clean unused entries (if bantime has expired)
|
{
|
||||||
|
LOCK(m_cs_banned);
|
||||||
if (!BannedSetIsDirty()) return;
|
SweepBanned();
|
||||||
|
if (!BannedSetIsDirty()) return;
|
||||||
|
}
|
||||||
|
|
||||||
int64_t n_start = GetTimeMillis();
|
int64_t n_start = GetTimeMillis();
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user