Minor thread fixes

Call thread result destructor
This commit is contained in:
Nekotekina 2018-10-01 20:05:47 +03:00
parent 7a024f3355
commit 3359e9a51b
2 changed files with 66 additions and 33 deletions

View file

@ -1807,13 +1807,7 @@ bool thread_ctrl::_wait_for(u64 usec)
void thread_base::_notify(cond_variable thread_base::* ptr)
{
// Optimized lock + unlock
if (!m_mutex.is_free())
{
m_mutex.lock();
m_mutex.unlock();
}
m_mutex.lock_unlock();
(this->*ptr).notify_one();
}
@ -1834,12 +1828,6 @@ thread_base::~thread_base()
}
}
std::exception_ptr thread_base::get_exception() const
{
std::lock_guard lock(m_mutex);
return m_exception;
}
void thread_base::set_exception(std::exception_ptr ptr)
{
std::lock_guard lock(m_mutex);