Skip to content

Commit

Permalink
bug fixes in assign operators for the engine
Browse files Browse the repository at this point in the history
  • Loading branch information
mdorier committed Aug 31, 2023
1 parent 200877c commit 53aeb8c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
22 changes: 20 additions & 2 deletions include/thallium/engine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,16 @@ class engine {
*/
engine& operator=(engine&& other) {
if(m_impl == other.m_impl) return *this;
if(m_impl) this->~engine();
if(m_impl && m_impl.use_count() == 1) {
margo_instance_id mid = m_impl->m_mid;
if(mid && m_impl->m_owns_mid) {
if(margo_is_listening(mid)) {
wait_for_finalize();
} else {
finalize();
}
}
}
m_impl = std::move(other.m_impl);
return *this;
}
Expand All @@ -263,7 +272,16 @@ class engine {
*/
engine& operator=(const engine& other) {
if(m_impl == other.m_impl) return *this;
if(m_impl) this->~engine();
if(m_impl && m_impl.use_count() == 1) {
margo_instance_id mid = m_impl->m_mid;
if(mid && m_impl->m_owns_mid) {
if(margo_is_listening(mid)) {
wait_for_finalize();
} else {
finalize();
}
}
}
m_impl = other.m_impl;
return *this;
}
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set (thallium-pkg "share/cmake/thallium")
#
set (THALLIUM_VERSION_MAJOR 0)
set (THALLIUM_VERSION_MINOR 11)
set (THALLIUM_VERSION_PATCH 1)
set (THALLIUM_VERSION_PATCH 2)
set (thallium-vers "${THALLIUM_VERSION_MAJOR}.${THALLIUM_VERSION_MINOR}")
set (THALLIUM_VERSION "${thallium-vers}.${THALLIUM_VERSION_PATCH}")

Expand Down

0 comments on commit 53aeb8c

Please sign in to comment.