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

@ -132,7 +132,7 @@ class thread_ctrl final
// Remotely set or caught exception
std::exception_ptr m_exception;
// Thread initial task or atexit task
// Thread initial task
task_stack m_task;
// Fixed name
@ -150,9 +150,6 @@ class thread_ctrl final
// Called at the thread end
void finalize(std::exception_ptr) noexcept;
// Add task (atexit)
static void _push(task_stack);
// Internal waiting function, may throw. Infinite value is -1.
static bool _wait_for(u64 usec);
@ -241,13 +238,6 @@ public:
return g_tls_this_thread;
}
// Register function at thread exit (for the current thread)
template<typename F>
static inline void atexit(F&& func)
{
_push(std::forward<F>(func));
}
// Create detached named thread
template<typename N, typename F>
static inline void spawn(N&& name, F&& func)