Skip to content

Commit

Permalink
Merge pull request #9 from marcvef/psm2_progress_fix
Browse files Browse the repository at this point in the history
Adding force_no_block_progress to engine_options
  • Loading branch information
alberto-miranda committed Jul 24, 2020
2 parents a25a82d + 8ee3fa1 commit 0af45bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions include/hermes/async_engine.hpp
Expand Up @@ -99,8 +99,7 @@ class async_engine {
m_transport(transport_type) {

// IMPORTANT: this struct needs to be zeroed before use
struct hg_init_info hg_options;
std::memset(&hg_options, 0, sizeof(hg_options));
struct hg_init_info hg_options = HG_INIT_INFO_INITIALIZER;

if(opts & use_auto_sm) {
hg_options.auto_sm = HG_TRUE;
Expand All @@ -110,7 +109,11 @@ class async_engine {
hg_options.stats = HG_TRUE;
}

m_hg_class =
if (opts & force_no_block_progress) {
hg_options.na_init_info.progress_mode = NA_NO_BLOCK;
}

m_hg_class =
detail::initialize_mercury(
get_transport_prefix(m_transport),
bind_address,
Expand Down
2 changes: 2 additions & 0 deletions include/hermes/options.hpp
Expand Up @@ -7,6 +7,7 @@ enum __engine_opts {
__none = 0,
__use_auto_sm = 1L << 0,
__print_stats = 1L << 1,
__force_no_block_progress = 1L << 2,
__engine_opts_end = 1L << 16,
__engine_opts_max = __INT_MAX__,
__engine_opts_min = ~__INT_MAX__
Expand Down Expand Up @@ -51,6 +52,7 @@ using engine_options = __engine_opts;

static const constexpr engine_options none = __engine_opts::__none;
static const constexpr engine_options use_auto_sm = __engine_opts::__use_auto_sm;
static const constexpr engine_options force_no_block_progress = __engine_opts::__force_no_block_progress;
static const constexpr engine_options print_stats = __engine_opts::__print_stats;

} // namespace hermes
Expand Down

0 comments on commit 0af45bf

Please sign in to comment.