本文整理汇总了C++中ThreadInfo::getEpoche方法的典型用法代码示例。如果您正苦于以下问题:C++ ThreadInfo::getEpoche方法的具体用法?C++ ThreadInfo::getEpoche怎么用?C++ ThreadInfo::getEpoche使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThreadInfo
的用法示例。
在下文中一共展示了ThreadInfo::getEpoche方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: insertGrow
void N::insertGrow(curN *n, uint64_t v, N *parentNode, uint64_t parentVersion, uint8_t keyParent, uint8_t key, N *val, bool &needRestart, ThreadInfo &threadInfo) {
if (!n->isFull()) {
if (parentNode != nullptr) {
parentNode->readUnlockOrRestart(parentVersion, needRestart);
if (needRestart) return;
}
n->upgradeToWriteLockOrRestart(v, needRestart);
if (needRestart) return;
n->insert(key, val);
n->writeUnlock();
return;
}
parentNode->upgradeToWriteLockOrRestart(parentVersion, needRestart);
if (needRestart) return;
n->upgradeToWriteLockOrRestart(v, needRestart);
if (needRestart) {
parentNode->writeUnlock();
return;
}
auto nBig = new biggerN(n->getPrefix(), n->getPrefixLength());
n->copyTo(nBig);
nBig->insert(key, val);
N::change(parentNode, keyParent, nBig);
n->writeUnlockObsolete();
threadInfo.getEpoche().markNodeForDeletion(n, threadInfo);
parentNode->writeUnlock();
}
示例2: removeAndShrink
void N::removeAndShrink(curN *n, uint64_t v, N *parentNode, uint64_t parentVersion, uint8_t keyParent, uint8_t key, bool &needRestart, ThreadInfo &threadInfo) {
if (!n->isUnderfull() || parentNode == nullptr) {
if (parentNode != nullptr) {
parentNode->readUnlockOrRestart(parentVersion, needRestart);
if (needRestart) return;
}
n->upgradeToWriteLockOrRestart(v, needRestart);
if (needRestart) return;
n->remove(key);
n->writeUnlock();
return;
}
parentNode->upgradeToWriteLockOrRestart(parentVersion, needRestart);
if (needRestart) return;
n->upgradeToWriteLockOrRestart(v, needRestart);
if (needRestart) {
parentNode->writeUnlock();
return;
}
auto nSmall = new smallerN(n->getPrefix(), n->getPrefixLength());
n->copyTo(nSmall);
nSmall->remove(key);
N::change(parentNode, keyParent, nSmall);
n->writeUnlockObsolete();
threadInfo.getEpoche().markNodeForDeletion(n, threadInfo);
parentNode->writeUnlock();
}
示例3: EpocheGuard
EpocheGuard(ThreadInfo<Key, Data> &threadEpocheInfo) : threadEpocheInfo(threadEpocheInfo) {
threadEpocheInfo.getEpoche().enterEpoche(threadEpocheInfo);
}