本文整理汇总了C++中parcel::get_action方法的典型用法代码示例。如果您正苦于以下问题:C++ parcel::get_action方法的具体用法?C++ parcel::get_action怎么用?C++ parcel::get_action使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类parcel
的用法示例。
在下文中一共展示了parcel::get_action方法的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());
}
}
}