Skip to content

Commit

Permalink
remove locks
Browse files Browse the repository at this point in the history
  • Loading branch information
cheniujh committed Aug 10, 2024
1 parent 3796bee commit 29ec978
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/pika_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ void BlockingBaseCmd::ServeAndUnblockConns(void* args) {
//[NOTICE]: within the next scope formed by 3 locks, other locks should never be acquired !
//WARNING: g_pika_server->GetDB(), g_pika_rm->GetSynMasterDB SHOULD NOT BE CALLED within the scope, or deadlock will happen !
pstd::lock::ScopeRecordLock record_lock(db->LockMgr(), key);//It's a RAII Lock
db->DBLockShared();
std::unique_lock map_lock(dispatchThread->GetBlockMtx());// do not change the sequence of these 3 locks, or deadlock will happen
auto it = key_to_conns_.find(blrPop_key);
if (it == key_to_conns_.end()) {
Expand Down Expand Up @@ -229,7 +228,6 @@ void BlockingBaseCmd::ServeAndUnblockConns(void* args) {
dispatchThread->CleanKeysAfterWaitNodeCleaned();
map_lock.unlock();
WriteBinlogOfPopAndUpdateCache(pop_binlog_args, db, sync_db);
db->DBUnlockShared();
}

void BlockingBaseCmd::WriteBinlogOfPopAndUpdateCache(std::vector<WriteBinlogOfPopArgs>& pop_args,
Expand Down

0 comments on commit 29ec978

Please sign in to comment.