File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 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) {
643643 unsigned long numkeys = 0 ;
644644 void *replylen = addReplyDeferredLen (c);
645645
646+ #ifdef MULTITHREADED_KEYS
646647 aeReleaseLock ();
648+ #endif
647649
648650 di = dictGetSafeIterator (c->db ->pdict );
649651 allkeys = (pattern[0 ] == ' *' && pattern[1 ] == ' \0 ' );
@@ -663,11 +665,13 @@ void keysCommand(client *c) {
663665 dictReleaseIterator (di);
664666 setDeferredArrayLen (c,replylen,numkeys);
665667
668+ #ifdef MULTITHREADED_KEYS
666669 fastlock_unlock (&c->db ->lock ); // we must release the DB lock before acquiring the AE lock to prevent deadlocks
667670 AeLocker lock;
668671 lock.arm (c);
669672 fastlock_lock (&c->db ->lock ); // we still need the DB lock
670673 lock.release ();
674+ #endif
671675}
672676
673677/* This callback is used by scanGenericCommand in order to collect elements
You can’t perform that action at this time.
0 commit comments