From c30e9b13850870e08e7e20dab37948fc1e3354b2 Mon Sep 17 00:00:00 2001 From: Jiakun Yan Date: Mon, 18 Dec 2023 11:54:19 -0600 Subject: [PATCH] fix(lci pp): fix the null_thread_id bug in the LCI parcelport `send()` in the LCI parcelport can call HPX `yield()`. However, `send()` can be called outside HPX threads, leading to HPX complaining "null_thread_id". --- libs/full/parcelport_lci/src/sender_connection_base.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/full/parcelport_lci/src/sender_connection_base.cpp b/libs/full/parcelport_lci/src/sender_connection_base.cpp index db78212232ee..92c1ba0c4445 100644 --- a/libs/full/parcelport_lci/src/sender_connection_base.cpp +++ b/libs/full/parcelport_lci/src/sender_connection_base.cpp @@ -73,7 +73,9 @@ namespace hpx::parcelset::policies::lci { while (pp_->background_work( -1, parcelport_background_mode_all)) continue; - hpx::this_thread::yield(); + if (hpx::threads::get_self_id() != + hpx::threads::invalid_thread_id) + hpx::this_thread::yield(); } if (config_t::progress_type == config_t::progress_type_t::worker ||