Skip to content

Commit

Permalink
minor windows cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
klemens-morgenstern committed Oct 25, 2023
1 parent 1873f34 commit f289f26
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
28 changes: 19 additions & 9 deletions include/boost/process/v2/detail/process_handle_windows.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,32 @@ struct basic_process_handle_win


template<typename Executor1>
basic_process_handle_win(basic_process_handle_win<Executor1> && handle)
: pid_(handle.pid_), handle_(std::move(handle.handle_))
basic_process_handle_win(basic_process_handle_win<Executor1> && other)
: pid_(handle.pid_), handle_(std::move(other.handle_))
{
other.pid_ = static_cast<DWORD>(-1);
}

basic_process_handle_win(basic_process_handle_win && handle)
: pid_(handle.id()), handle_(std::move(handle.handle_))
basic_process_handle_win(basic_process_handle_win && other)
: pid_(handle.pid_), handle_(std::move(other.handle_))
{
handle.pid_ = static_cast<DWORD>(-1);
other.pid_ = static_cast<DWORD>(-1);
}

basic_process_handle_win& operator=(basic_process_handle_win && handle)
basic_process_handle_win& operator=(basic_process_handle_win && other)
{
pid_ = handle.pid_;
handle_ = std::move(handle.handle_);
handle.pid_ = static_cast<DWORD>(-1);
pid_ = other.pid_;
handle_ = std::move(other.handle_);
other.pid_ = static_cast<DWORD>(-1);
return *this;
}

template<typename Executor1>
basic_process_handle_win& operator=(basic_process_handle_win<Executor1> && other)
{
pid_ = other.pid_;
handle_ = std::move(other.handle_);
other.pid_ = static_cast<DWORD>(-1);
return *this;
}

Expand Down
2 changes: 1 addition & 1 deletion test/v2/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ BOOST_AUTO_TEST_CASE(async_request_exit)
#endif
);

asio::steady_timer tim{ctx, std::chrono::milliseconds(50)};
asio::steady_timer tim{ctx, std::chrono::milliseconds(250)};
asio::cancellation_signal sig;

bpv::async_execute(std::move(proc),
Expand Down

0 comments on commit f289f26

Please sign in to comment.