Skip to content

Commit

Permalink
Update exception_list.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
charan-003 authored Nov 10, 2024
1 parent f0032e1 commit 878e897
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions libs/core/errors/include/hpx/errors/exception_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ namespace hpx {
// TODO: Does this need to be hpx::spinlock?
// typedef hpx::spinlock mutex_type;
// TODO: Add correct initialization of hpx::util::detail spinlock.
// using mutex_type = hpx::util::detail::spinlock;
using mutex_type = hpx::util::detail::spinlock;

using exception_list_type = std::list<std::exception_ptr>;
exception_list_type exceptions_;
mutable mutex_type mtx_;
Expand All @@ -60,10 +60,21 @@ namespace hpx {
~exception_list() noexcept override = default;

exception_list();
explicit exception_list(std::exception_ptr const& e);
explicit exception_list(exception_list_type&& l);
explicit exception_list(std::exception_ptr const& e)
{
add(e);
}
explicit exception_list(exception_list_type&& l)
{
std::lock_guard<mutex_type> lock(mtx_);
exceptions_ = std::move(l);
}

exception_list(exception_list const& l);
exception_list(exception_list const& l)
{
std::lock_guard<mutex_type> lock(l.mtx_);
exceptions_ = l.exceptions_;
}
exception_list(exception_list&& l) noexcept
{
std::lock_guard<mutex_type> l_lock(l.mtx_);
Expand Down

0 comments on commit 878e897

Please sign in to comment.