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


C++ currentThread函数代码示例

本文整理汇总了C++中currentThread函数的典型用法代码示例。如果您正苦于以下问题:C++ currentThread函数的具体用法?C++ currentThread怎么用?C++ currentThread使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了currentThread函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: currentThread

bool 
Thread::interrupted()
{
    ThreadHandle handle = currentThread();
  
    if(!handle.is_null()) {
        return handle->consumeInterruptionSync();
    } else {
        return false;
    }
};
开发者ID:AlvaroVega,项目名称:TIDorbC,代码行数:11,代码来源:Thread.C

示例2: add

void AddThr::run()
{
	Functions::DemuxersInfo demuxersInfo;
	for (Module *module : QMPlay2Core.getPluginsInstance())
		for (const Module::Info &mod : module->getModulesInfo())
			if (mod.type == Module::DEMUXER)
				demuxersInfo += {mod.name, mod.icon.isNull() ? module->icon() : mod.icon, mod.extensions};
	add(urls, par, demuxersInfo, existingEntries.isEmpty() ? nullptr : &existingEntries, loadList);
	if (currentThread() == pLW.thread()) //jeżeli funkcja działa w głównym wątku
		finished();
}
开发者ID:arthurzam,项目名称:QMPlay2,代码行数:11,代码来源:PlaylistWidget.cpp

示例3: ASSERT

void SQLTransactionBackend::notifyDatabaseThreadIsShuttingDown()
{
    ASSERT(currentThread() == database()->databaseContext()->databaseThread()->getThreadID());

    // If the transaction is in progress, we should roll it back here, since this
    // is our last opportunity to do something related to this transaction on the
    // DB thread. Amongst other work, doCleanup() will clear m_sqliteTransaction
    // which invokes SQLiteTransaction's destructor, which will do the roll back
    // if necessary.
    doCleanup();
}
开发者ID:Channely,项目名称:know-your-chrome,代码行数:11,代码来源:SQLTransactionBackend.cpp

示例4: ASSERT

RefPtr<DOMStringList> IDBObjectStore::indexNames() const
{
    ASSERT(currentThread() == m_transaction->database().originThreadID());

    RefPtr<DOMStringList> indexNames = DOMStringList::create();
    for (auto& name : m_info.indexNames())
        indexNames->append(name);
    indexNames->sort();

    return indexNames;
}
开发者ID:caiolima,项目名称:webkit,代码行数:11,代码来源:IDBObjectStore.cpp

示例5: context

bool OfflineAudioDestinationHandler::renderIfNotSuspended(AudioBus* sourceBus, AudioBus* destinationBus, size_t numberOfFrames)
{
    // We don't want denormals slowing down any of the audio processing
    // since they can very seriously hurt performance.
    // This will take care of all AudioNodes because they all process within this scope.
    DenormalDisabler denormalDisabler;

    context()->deferredTaskHandler().setAudioThread(currentThread());

    if (!context()->isDestinationInitialized()) {
        destinationBus->zero();
        return false;
    }

    // Take care pre-render tasks at the beginning of each render quantum. Then
    // it will stop the rendering loop if the context needs to be suspended
    // at the beginning of the next render quantum.
    if (context()->handlePreOfflineRenderTasks()) {
        suspendOfflineRendering();
        return true;
    }

    // Prepare the local audio input provider for this render quantum.
    if (sourceBus)
        m_localAudioInputProvider.set(sourceBus);

    ASSERT(numberOfInputs() >= 1);
    if (numberOfInputs() < 1) {
        destinationBus->zero();
        return false;
    }
    // This will cause the node(s) connected to us to process, which in turn will pull on their input(s),
    // all the way backwards through the rendering graph.
    AudioBus* renderedBus = input(0).pull(destinationBus, numberOfFrames);

    if (!renderedBus) {
        destinationBus->zero();
    } else if (renderedBus != destinationBus) {
        // in-place processing was not possible - so copy
        destinationBus->copyFrom(*renderedBus);
    }

    // Process nodes which need a little extra help because they are not connected to anything, but still need to process.
    context()->deferredTaskHandler().processAutomaticPullNodes(numberOfFrames);

    // Let the context take care of any business at the end of each render quantum.
    context()->handlePostOfflineRenderTasks();

    // Advance current sample-frame.
    size_t newSampleFrame = m_currentSampleFrame + numberOfFrames;
    releaseStore(&m_currentSampleFrame, newSampleFrame);

    return false;
}
开发者ID:joone,项目名称:chromium-crosswalk,代码行数:54,代码来源:OfflineAudioDestinationNode.cpp

示例6: m_nextFireTime

TimerBase::TimerBase()
    : m_nextFireTime(0)
    , m_unalignedNextFireTime(0)
    , m_repeatInterval(0)
    , m_heapIndex(-1)
    , m_cachedThreadGlobalTimerHeap(0)
#if ENABLE(ASSERT)
    , m_thread(currentThread())
#endif
{
}
开发者ID:Rajesh-Veeranki,项目名称:engine,代码行数:11,代码来源:Timer.cpp

示例7: LOG

void IDBOpenDBRequest::onSuccess(const IDBResultData& resultData)
{
    LOG(IndexedDB, "IDBOpenDBRequest::onSuccess()");

    ASSERT(currentThread() == originThreadID());

    setResult(IDBDatabase::create(*scriptExecutionContext(), connectionProxy(), resultData));
    m_isDone = true;

    enqueueEvent(IDBRequestCompletionEvent::create(eventNames().successEvent, false, false, *this));
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:11,代码来源:IDBOpenDBRequest.cpp

示例8: ASSERT

bool IDBOpenDBRequest::dispatchEvent(Event& event)
{
    ASSERT(currentThread() == originThreadID());

    bool result = IDBRequest::dispatchEvent(event);

    if (m_transaction && m_transaction->isVersionChange() && (event.type() == eventNames().errorEvent || event.type() == eventNames().successEvent))
        m_transaction->database().connectionProxy().didFinishHandlingVersionChangeTransaction(m_transaction->database().databaseConnectionIdentifier(), *m_transaction);

    return result;
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:11,代码来源:IDBOpenDBRequest.cpp

示例9: ASSERT

void TimerBase::stop()
{
    ASSERT(m_thread == currentThread());

    m_repeatInterval = 0;
    setNextFireTime(0);

    ASSERT(m_nextFireTime == 0);
    ASSERT(m_repeatInterval == 0);
    ASSERT(!inHeap());
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:11,代码来源:Timer.cpp

示例10: m_thread

ThreadState::ThreadState(intptr_t* startOfStack)
    : m_thread(currentThread())
    , m_startOfStack(startOfStack)
{
    ASSERT(!**s_threadSpecific);
    **s_threadSpecific = this;

    // FIXME: This is to silence clang that complains about unused private
    // member. Remove once we implement stack scanning that uses it.
    (void) m_startOfStack;
}
开发者ID:Metrological,项目名称:chromium,代码行数:11,代码来源:ThreadState.cpp

示例11: LOG

void IDBDatabase::didCommitTransaction(IDBTransaction& transaction)
{
    LOG(IndexedDB, "IDBDatabase::didCommitTransaction %s", transaction.info().identifier().loggingString().utf8().data());

    ASSERT(currentThread() == originThreadID());

    if (m_versionChangeTransaction == &transaction)
        m_info.setVersion(transaction.info().newVersion());

    didCommitOrAbortTransaction(transaction);
}
开发者ID:eocanha,项目名称:webkit,代码行数:11,代码来源:IDBDatabase.cpp

示例12: m_scriptExecutionContext

WorkerMessagingProxy::WorkerMessagingProxy(Worker* workerObject)
    : m_scriptExecutionContext(workerObject->scriptExecutionContext())
    , m_workerObject(workerObject)
    , m_unconfirmedMessageCount(0)
    , m_workerThreadHadPendingActivity(false)
    , m_askedToTerminate(false)
{
    ASSERT(m_workerObject);
    ASSERT((m_scriptExecutionContext->isDocument() && isMainThread())
           || (m_scriptExecutionContext->isWorkerContext() && currentThread() == static_cast<WorkerContext*>(m_scriptExecutionContext.get())->thread()->threadID()));
}
开发者ID:azrul2202,项目名称:WebKit-Smartphone,代码行数:11,代码来源:WorkerMessagingProxy.cpp

示例13: ASSERT

void IDBDatabase::renameIndex(IDBIndex& index, const String& newName)
{
    ASSERT(currentThread() == originThreadID());
    ASSERT(m_versionChangeTransaction);
    ASSERT(m_info.hasObjectStore(index.objectStore().info().name()));
    ASSERT(m_info.infoForExistingObjectStore(index.objectStore().info().name())->hasIndex(index.info().name()));

    m_info.infoForExistingObjectStore(index.objectStore().info().name())->infoForExistingIndex(index.info().identifier())->rename(newName);

    m_versionChangeTransaction->renameIndex(index, newName);
}
开发者ID:eocanha,项目名称:webkit,代码行数:11,代码来源:IDBDatabase.cpp

示例14: ASSERT

void TimerBase::stop()
{
    ASSERT(m_thread == currentThread() || (isMainThread() || pthread_main_np()) && WebCoreWebThreadIsLockedOrDisabled());

    m_repeatInterval = 0;
    setNextFireTime(0);

    ASSERT(m_nextFireTime == 0);
    ASSERT(m_repeatInterval == 0);
    ASSERT(!inHeap());
}
开发者ID:sanyaade-mobiledev,项目名称:Webkit-Projects,代码行数:11,代码来源:Timer.cpp

示例15: m_nextFireTime

TimerBase::TimerBase()
    : m_nextFireTime(0)
    , m_unalignedNextFireTime(0)
    , m_repeatInterval(0)
    , m_heapIndex(-1)
    , m_cachedThreadGlobalTimerHeap(0)
#ifndef NDEBUG
    , m_thread(currentThread())
    , m_wasDeleted(false)
#endif
{
}
开发者ID:caiolima,项目名称:webkit,代码行数:12,代码来源:Timer.cpp


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