当前位置: 首页>>代码示例>>C++>>正文


C++ ThreadInfo::getEpoche方法代码示例

本文整理汇总了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();
    }
开发者ID:HanumathRao,项目名称:ARTSynchronized,代码行数:32,代码来源:N.cpp

示例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();
    }
开发者ID:HanumathRao,项目名称:ARTSynchronized,代码行数:32,代码来源:N.cpp

示例3: EpocheGuard

 EpocheGuard(ThreadInfo<Key, Data> &threadEpocheInfo) : threadEpocheInfo(threadEpocheInfo) {
     threadEpocheInfo.getEpoche().enterEpoche(threadEpocheInfo);
 }
开发者ID:EmersonDing,项目名称:BwTree,代码行数:3,代码来源:epoque.hpp


注:本文中的ThreadInfo::getEpoche方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。