Remove thread_ctrl::atexit

It was only a workaround for poor C++11 thread_local support
This commit is contained in:
Nekotekina 2018-09-15 14:42:14 +03:00
parent f2229a5f53
commit c5676e5649
4 changed files with 16 additions and 57 deletions

View file

@ -1654,9 +1654,8 @@ void thread_ctrl::initialize()
void thread_ctrl::finalize(std::exception_ptr eptr) noexcept
{
// Run atexit functions
m_task.invoke();
m_task.reset();
// Report pending errors
error_code::error_report(0, 0, 0, 0);
#ifdef _WIN32
ULONG64 cycles{};
@ -1695,11 +1694,6 @@ void thread_ctrl::finalize(std::exception_ptr eptr) noexcept
m_jcv.notify_all();
}
void thread_ctrl::_push(task_stack task)
{
g_tls_this_thread->m_task.push(std::move(task));
}
bool thread_ctrl::_wait_for(u64 usec)
{
auto _this = g_tls_this_thread;