From 4bef0f8dabaac6d9155774b7d61ff33c7deb644a Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Tue, 2 Oct 2018 17:49:53 +0300 Subject: [PATCH] Rename thread_abort (name conflict) --- Utilities/Thread.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Utilities/Thread.h b/Utilities/Thread.h index 46c1b94ba0..dca858baed 100644 --- a/Utilities/Thread.h +++ b/Utilities/Thread.h @@ -84,10 +84,17 @@ using result_storage_t = result_storage>; // Detect on_abort() method (should return void) template -struct thread_abort : std::bool_constant {}; +struct thread_on_abort : std::bool_constant {}; template -struct thread_abort&>().on_abort())> : std::bool_constant {}; +struct thread_on_abort&>().on_abort())> : std::bool_constant {}; + +// Detect on_cleanup() static function (should return void) +template +struct thread_on_cleanup : std::bool_constant {}; + +template +struct thread_on_cleanup::on_cleanup(std::declval*>()))> : std::bool_constant {}; // Simple list of void() functors class task_stack @@ -498,7 +505,7 @@ public: if (thread::m_state.compare_and_swap_test(thread_state::created, thread_state::aborting)) { // Call on_abort() method if it's available - if constexpr (thread_abort()) + if constexpr (thread_on_abort()) { Context::on_abort(); }