Skip to content

Commit

Permalink
Remove a global lock
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSully committed Sep 25, 2023
1 parent f0e8c6f commit cdc5e8f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion src/db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3181,7 +3181,7 @@ void redisDbPersistentData::trackChanges(bool fBulk, size_t sizeHint)
if (fBulk)
m_fAllChanged.fetch_add(1, std::memory_order_acq_rel);

if (sizeHint > 0)
if (sizeHint > 0 && aeThreadOwnsLock())
dictExpand(m_dictChanged, sizeHint, false);
}

Expand Down
2 changes: 0 additions & 2 deletions src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3068,10 +3068,8 @@ void afterSleep(struct aeEventLoop *eventLoop) {
serverAssert(serverTL->gcEpoch.isReset());
serverTL->gcEpoch = g_pserver->garbageCollector.startEpoch();

aeAcquireLock();
for (int idb = 0; idb < cserver.dbnum; ++idb)
g_pserver->db[idb]->trackChanges(false);
aeReleaseLock();

serverTL->disable_async_commands = false;
}
Expand Down

0 comments on commit cdc5e8f

Please sign in to comment.