Prevent dictRehashMilliseconds from rehashing while a safe iterator is present (#5948)

This commit is contained in:
Jim Brunner 2020-08-10 22:36:34 -07:00 committed by GitHub
parent 229327ad8b
commit f39c9404a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -239,6 +239,8 @@ long long timeInMilliseconds(void) {
/* Rehash for an amount of time between ms milliseconds and ms+1 milliseconds */
int dictRehashMilliseconds(dict *d, int ms) {
if (d->iterators > 0) return 0;
long long start = timeInMilliseconds();
int rehashes = 0;