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


C++ parcel::get_continuation方法代码示例

本文整理汇总了C++中parcel::get_continuation方法的典型用法代码示例。如果您正苦于以下问题:C++ parcel::get_continuation方法的具体用法?C++ parcel::get_continuation怎么用?C++ parcel::get_continuation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在parcel的用法示例。


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

示例1: add_received_parcel

    void parcelport::add_received_parcel(parcel p, std::size_t num_thread)
    {
        // do some work (notify event handlers)
        if(applier_)
        {
            while (threads::threadmanager_is(state_starting))
            {
                boost::this_thread::sleep(boost::get_system_time() +
                    boost::posix_time::milliseconds(HPX_NETWORK_RETRIES_SLEEP));
            }

            // Give up if we're shutting down.
            if (threads::threadmanager_is(state_stopping))
            {
    //             LPT_(debug) << "parcelport: add_received_parcel: dropping late "
    //                             "parcel " << p;
                return;
            }

            // write this parcel to the log
    //         LPT_(debug) << "parcelport: add_received_parcel: " << p;

            applier_->schedule_action(std::move(p));
        }
        // If the applier has not been set yet, we are in bootstrapping and
        // need to execute the action directly
        else
        {
            // TODO: Make assertions exceptions
            // decode the action-type in the parcel
            actions::base_action * act = p.get_action();

            // early parcels should only be plain actions
            HPX_ASSERT(actions::base_action::plain_action == act->get_action_type());

            // early parcels can't have continuations
            HPX_ASSERT(!p.get_continuation());

            // We should not allow any exceptions to escape the execution of the
            // action as this would bring down the ASIO thread we execute in.
            try {
                act->get_thread_function(0)
                    (threads::thread_state_ex(threads::wait_signaled));
            }
            catch (...) {
                hpx::report_error(boost::current_exception());
            }
        }
    }
开发者ID:wzugang,项目名称:hpx,代码行数:49,代码来源:parcelport.cpp


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