本文整理汇总了C++中tbb::concurrent_bounded_queue::pop方法的典型用法代码示例。如果您正苦于以下问题:C++ concurrent_bounded_queue::pop方法的具体用法?C++ concurrent_bounded_queue::pop怎么用?C++ concurrent_bounded_queue::pop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tbb::concurrent_bounded_queue
的用法示例。
在下文中一共展示了concurrent_bounded_queue::pop方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run
// Call all DOs which are linked to that DOs which have been triggered
// These method is typically private and called with in a thread related to a priority
// This thread is typically waiting on a synchronization element
void run(unsigned inst) {
std::function<void()> f;
try {
#ifdef __linux__
Logger::pLOG->info("DOR-THRD-{} has TID-{}", inst, syscall(SYS_gettid));
#endif
while (_run_state) {
_tbbExecutionQueue.pop(f); // Pop of concurrent_bounded_queue waits if queue empty
f();
}
} catch(const tbb::user_abort& abortException) {
Logger::pLOG->info("Abort DOR-THRD-{}", inst);
_run_state = false;
}
Logger::pLOG->info("DOR-THRD-{} has stopped", inst);
}
示例2: OnGetData
virtual bool OnGetData(sf::SoundStream::Chunk& data) override
{
win32_exception::ensure_handler_installed_for_thread(
"sfml-audio-thread");
std::pair<std::shared_ptr<core::read_frame>, std::shared_ptr<audio_buffer_16>> audio_data;
input_.pop(audio_data); // Block until available
graph_->set_value("tick-time", perf_timer_.elapsed()*format_desc_.fps*0.5);
perf_timer_.restart();
container_.push_back(std::move(*audio_data.second));
data.Samples = container_.back().data();
data.NbSamples = container_.back().size();
if (audio_data.first)
presentation_age_ = audio_data.first->get_age_millis();
return is_running_;
}