File tree 1 file changed +4
-0
lines changed
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -643,7 +643,9 @@ void keysCommand(client *c) {
643
643
unsigned long numkeys = 0 ;
644
644
void *replylen = addReplyDeferredLen (c);
645
645
646
+ #ifdef MULTITHREADED_KEYS
646
647
aeReleaseLock ();
648
+ #endif
647
649
648
650
di = dictGetSafeIterator (c->db ->pdict );
649
651
allkeys = (pattern[0 ] == ' *' && pattern[1 ] == ' \0 ' );
@@ -663,11 +665,13 @@ void keysCommand(client *c) {
663
665
dictReleaseIterator (di);
664
666
setDeferredArrayLen (c,replylen,numkeys);
665
667
668
+ #ifdef MULTITHREADED_KEYS
666
669
fastlock_unlock (&c->db ->lock ); // we must release the DB lock before acquiring the AE lock to prevent deadlocks
667
670
AeLocker lock;
668
671
lock.arm (c);
669
672
fastlock_lock (&c->db ->lock ); // we still need the DB lock
670
673
lock.release ();
674
+ #endif
671
675
}
672
676
673
677
/* This callback is used by scanGenericCommand in order to collect elements
You can’t perform that action at this time.
0 commit comments