mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 13:31:27 +12:00
noexcept usage fixed
thread_t renamed to named_thread_t
This commit is contained in:
parent
168cd9bb7a
commit
5e14310071
26 changed files with 82 additions and 96 deletions
|
@ -1199,20 +1199,21 @@ std::string thread_ctrl_t::get_name() const
|
|||
return name();
|
||||
}
|
||||
|
||||
thread_t::thread_t(std::function<std::string()> name, std::function<void()> func)
|
||||
named_thread_t::named_thread_t(std::function<std::string()> name, std::function<void()> func)
|
||||
{
|
||||
start(std::move(name), func);
|
||||
}
|
||||
|
||||
thread_t::~thread_t() //noexcept(false)
|
||||
named_thread_t::~named_thread_t()
|
||||
{
|
||||
if (m_thread)
|
||||
{
|
||||
throw EXCEPTION("Neither joined nor detached");
|
||||
std::printf("Fatal: thread '%s' is neither joined nor detached\n", this->get_name().c_str());
|
||||
std::terminate();
|
||||
}
|
||||
}
|
||||
|
||||
std::string thread_t::get_name() const
|
||||
std::string named_thread_t::get_name() const
|
||||
{
|
||||
if (!m_thread)
|
||||
{
|
||||
|
@ -1229,7 +1230,7 @@ std::string thread_t::get_name() const
|
|||
|
||||
std::atomic<u32> g_thread_count{ 0 };
|
||||
|
||||
void thread_t::start(std::function<std::string()> name, std::function<void()> func)
|
||||
void named_thread_t::start(std::function<std::string()> name, std::function<void()> func)
|
||||
{
|
||||
if (m_thread)
|
||||
{
|
||||
|
@ -1302,7 +1303,7 @@ void thread_t::start(std::function<std::string()> name, std::function<void()> fu
|
|||
}, m_thread, std::move(func));
|
||||
}
|
||||
|
||||
void thread_t::detach()
|
||||
void named_thread_t::detach()
|
||||
{
|
||||
if (!m_thread)
|
||||
{
|
||||
|
@ -1324,7 +1325,7 @@ void thread_t::detach()
|
|||
ctrl->m_thread.detach();
|
||||
}
|
||||
|
||||
void thread_t::join()
|
||||
void named_thread_t::join()
|
||||
{
|
||||
if (!m_thread)
|
||||
{
|
||||
|
@ -1349,7 +1350,7 @@ void thread_t::join()
|
|||
ctrl->m_thread.join();
|
||||
}
|
||||
|
||||
bool thread_t::is_current() const
|
||||
bool named_thread_t::is_current() const
|
||||
{
|
||||
if (!m_thread)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue