dict.c: added optional callback to dictEmpty().

Redis hash table implementation has many non-blocking features like
incremental rehashing, however while deleting a large hash table there
was no way to have a callback called to do some incremental work.

This commit adds this support, as an optiona callback argument to
dictEmpty() that is currently called at a fixed interval (one time every
65k deletions).
This commit is contained in:
antirez
2013-12-10 18:18:24 +01:00
parent 26cf5c8ac6
commit b6610a569d
8 changed files with 22 additions and 21 deletions

View File

@ -837,7 +837,7 @@ void unblockClientWaitingData(redisClient *c) {
dictReleaseIterator(di);
/* Cleanup the client structure */
dictEmpty(c->bpop.keys);
dictEmpty(c->bpop.keys,NULL);
if (c->bpop.target) {
decrRefCount(c->bpop.target);
c->bpop.target = NULL;