MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / discontinueAsyncRehash

Function discontinueAsyncRehash

src/dict.cpp:476–490  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

474
475
476void discontinueAsyncRehash(dict *d) {
477 // We inform our async rehashers and the completion function the results are to be
478 // abandoned. We keep the asyncdata linked in so that dictEntry's are still added
479 // to the GC list. This is because we can't gurantee when the other threads will
480 // stop looking at them.
481 if (d->asyncdata != nullptr) {
482 auto adata = d->asyncdata;
483 while (adata != nullptr && !adata->abondon.load(std::memory_order_relaxed)) {
484 adata->abondon = true;
485 adata = adata->next;
486 }
487 if (dictIsRehashing(d))
488 d->rehashidx = 0;
489 }
490}
491
492void dictCompleteRehashAsync(dictAsyncRehashCtl *ctl, bool fFree) {
493 dict *d = ctl->dict;

Callers 2

createSnapshotMethod · 0.85
swapMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected