Documentation Home >> Headers >> <jss/joining_thread.hpp> Header >> jss::joining_thread >> jss::joining_thread::swap member function

Exchanges ownership of their associated threads of execution between two jss::joining_thread objects.

void swap(joining_thread& other);

Effects:

If other has an associated thread of execution prior to the call, that thread of execution is now associated with *this. Otherwise *this has no associated thread of execution. If *this has an associated thread of execution prior to the call, that thread of execution is now associated with other. Otherwise other has no associated thread of execution.

Postconditions:

this->get_id() is equal to the value of other.get_id() prior to the call. other.get_id() is equal to the value of this->get_id() prior to the call.

Throws:

Nothing

Header

#include <jss/joining_thread.hpp>

See Also