named_thread: install atomic wait callback
This commit is contained in:
+12
-1
@@ -1667,11 +1667,14 @@ void thread_base::start(native_entry entry)
|
||||
#endif
|
||||
}
|
||||
|
||||
void thread_base::initialize()
|
||||
void thread_base::initialize(bool(*wait_cb)(const void*))
|
||||
{
|
||||
// Initialize TLS variable
|
||||
thread_ctrl::g_tls_this_thread = this;
|
||||
|
||||
// Initialize atomic wait callback
|
||||
atomic_storage_futex::set_wait_callback(wait_cb);
|
||||
|
||||
g_tls_log_prefix = []
|
||||
{
|
||||
return thread_ctrl::g_tls_this_thread->m_name.get();
|
||||
@@ -1718,6 +1721,14 @@ void thread_base::initialize()
|
||||
#endif
|
||||
}
|
||||
|
||||
void thread_base::notify_abort() noexcept
|
||||
{
|
||||
// For now
|
||||
notify();
|
||||
|
||||
atomic_storage_futex::raw_notify(+m_state_notifier);
|
||||
}
|
||||
|
||||
bool thread_base::finalize(int) noexcept
|
||||
{
|
||||
// Report pending errors
|
||||
|
||||
Reference in New Issue
Block a user