fix hash item moved iteration

This commit is contained in:
Jethro Grassie 2020-09-24 17:04:28 -04:00
parent e4b6d1ffa2
commit ff323609b9
No known key found for this signature in database
GPG key ID: DE8ED755616565BB

View file

@ -1399,7 +1399,10 @@ accounts_moved(const void *items, size_t count)
e = s + count; e = s + count;
pthread_rwlock_wrlock(&rwlock_acc); pthread_rwlock_wrlock(&rwlock_acc);
while (s<e) while (s<e)
{
HASH_REPLACE_STR(accounts, address, s, r); HASH_REPLACE_STR(accounts, address, s, r);
s++;
}
pthread_rwlock_unlock(&rwlock_acc); pthread_rwlock_unlock(&rwlock_acc);
} }
@ -1411,7 +1414,10 @@ clients_moved(const void *items, size_t count)
e = s + count; e = s + count;
pthread_rwlock_wrlock(&rwlock_cfd); pthread_rwlock_wrlock(&rwlock_cfd);
while (s<e) while (s<e)
{
HASH_REPLACE_INT(clients_by_fd, fd, s, r); HASH_REPLACE_INT(clients_by_fd, fd, s, r);
s++;
}
pthread_rwlock_unlock(&rwlock_cfd); pthread_rwlock_unlock(&rwlock_cfd);
} }